SQL 跨服务器 -查询 修改

update [Business_TasksAffirm] 
SET driver_name=b.driver_name,PictureId=b.PictureId,iJsDoneState=1,iSIncluded=1,iSWages=1,UserId=b.UserId,UserName=b.UserName,AuditTime=b.AuditTime,cExDescription=b.cExDescription 
from [表]  a 
left join openrowset( 'SQLOLEDB', '服务器地址'; '账号'; '密码',[数据库].dbo.表]) b 
on a.task_code = b.task_code
where b.iJsDoneState=1

 

posted @ 2023-04-24 13:50  进步者One  阅读(31)  评论(0编辑  收藏  举报