开发者

Update field with data from another database [closed]

开发者 https://www.devze.com 2023-02-09 14:52 出处:网络
Closed. This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post.
Closed. This question needs details or clarity. It is not currently accepting answers.

Want to improve this question? Add details and clarify the problem by editing this post.

Closed 8 years ago.

Improve this question

Need to update a field with data from another field in a different database

I Have two SQL commercial Databases from the same company, the first Database has one field that is null in the o开发者_Go百科ther

I need to update the Field/Database that is null with the data of the first one.


MS SQL Server

Update table1 in current database from table1 in database called "DataBaseName"

update table1
set col2 = T2.col2
from DataBaseName.dbo.table1 as T2
  where table1.ID = T2.ID and
        table1.col2 is null
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号