sql server 中两个关联表之间更新数据

环境: sql server 2008 r2 

不废话了,上sql

 

UPDATE dbo.Emp_BasicInfoRegister SET dbo.Emp_BasicInfoRegister.HasPhoto = dbo.Emp_BasicInfo.HasPhoto
, dbo.Emp_BasicInfoRegister.PhotoName = dbo.Emp_BasicInfo.PhotoName
FROM dbo.Emp_BasicInfo
WHERE dbo.Emp_BasicInfo.CardNo = dbo.Emp_BasicInfoRegister.CardNo
AND dbo.Emp_BasicInfo.Name = dbo.Emp_BasicInfoRegister.Name

posted @ 2012-11-28 15:51  tollinxu  阅读(324)  评论(0编辑  收藏  举报