SQL-Server-只还原某个字段

今天工作没有在状态,对project表执行update时没有写where语句。

update project set extselectitemfield13 = '8a2135646627e8a90166566485045ff8'

还好昨天有做备份,美滋滋。但是问题来了,能不能只还原extselectitemfield13这一个字段呢,因为还做过其他修改,如果整张表全部还原那么今天做的工作就全白费了。以前就遇到这个问题,但是没有是实现,这次又不死心试了试,终于写了出来。废话不多说,上干货。

update project set extselectitemfield13=
(select  extselectitemfield13 from  [test1].[dbo].[project] a where a.id= project.id)

首先,把昨天备份的还原到test1,然后执行如上SQL即可。

猜你喜欢

转载自blog.csdn.net/u010622242/article/details/82982576