How to UPDATE all columns of a record without having to list every column

后端 未结 8 1893
情歌与酒
情歌与酒 2020-12-29 03:20

I\'m trying to figure out a way to update a record without having to list every column name that needs to be updated.

For instance, it would be nice if I could use so

8条回答
  •  没有蜡笔的小新
    2020-12-29 03:47

    This is not posible, but..

    you can doit:

    begin tran
    delete from table where CONDITION
    insert into table select * from EqualDesingTabletoTable where CONDITION
    commit tran
    

    be carefoul with identity fields.

提交回复
热议问题