更新 update a..a1 set a2=bb.b2 from a..a1 left join b..b1 on a1.a1=b1.b1
你写得太乱了! 规则是: 库名..表名修改的模版: update table1 set table1.b=f.b from @a as f where table1.a=f.a
update a1 set a2=bb.b2 from a1 ,b1 where a1.a1=b1.b1
庫名.擁有者.表名試試...update A1 set A.dbo.A1.a2=B.dbo.B1.b2 where A.dbo.A1.a1=B.dbo.B1.b1
帮你翻译了一下,你要学方法:update 库名1..表1 set 被改的列名=别名2.源列名 from 库名2..表名2 别名2 where 库名1..表1.关键列=别名2.关键列
update A1 set A.dbo.A1.a2=B.dbo.B1.b2 where A.dbo.A1.a1=B.dbo.B1.b1
update A1 set A.A1.dbo.a2=B.B1.dbo.b2 where A.A1.dbo.a1=B.B1.dbo.b1 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~就是把表名和用户名的顺序搞反了,用户名在前面 A.A1.dbo.a2 改为 A.dbo.A1.a2其余一样。
基本的update 库名1..表1 set 被改的列名=别名2.源列名 from 库名2..表名2 别名2 where 库名1..表1.关键列=别名2.关键列
说完了是以下格式 update A1 set A.dbo.A1.a2=B.dbo.B1.b2 where A.dbo.A1.a1=B.dbo.B1.b1
update a..a1 set a2=bb.b2 from a..a1 left join b..b1 on a1.a1=b1.b1
规则是:
库名..表名修改的模版:
update table1 set table1.b=f.b from @a as f where table1.a=f.a
set A.dbo.A1.a2=B.dbo.B1.b2
where A.dbo.A1.a1=B.dbo.B1.b1
set A.dbo.A1.a2=B.dbo.B1.b2
where A.dbo.A1.a1=B.dbo.B1.b1
set A.A1.dbo.a2=B.B1.dbo.b2
where A.A1.dbo.a1=B.B1.dbo.b1
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~就是把表名和用户名的顺序搞反了,用户名在前面
A.A1.dbo.a2 改为 A.dbo.A1.a2其余一样。
update A1
set A.dbo.A1.a2=B.dbo.B1.b2
where A.dbo.A1.a1=B.dbo.B1.b1