SQL高手快来啊,要下班了

来源:百度知道 编辑:UC知道 时间:2024/05/16 16:06:02
同一个服务器上有
数据库A
数据库B
数据库A有表T1
数据库B有表T1
表T1都含有字段ID和Path
我需要把库A的表T1的Path信息更新到
库B的表T1的ID相同的Path字段,怎么办啊,高手帮帮我啊!
噢,是MSSQL数据库

USE B
update T1
set Path=b.Path from T1 as a, A.dbo.T1 as b where a.ID=b.ID

跨数据库之间表的拷贝(具体数据使用绝对路径) (Access可用)
insert into b(a, b, c) select d,e,f from b in ‘具体数据库’ where 条件
例子:..from b in '"&Server.MapPath(".")&"\data.mdb" &"' where..

update B.dbo.T1 set B.dbo.T1.Path=A.dbo.T1.Path from A.dbo.T1 where A.dbo.T1.ID=B.dbo.T1.ID