涉及到跨数据库问题,如果是在数据库的“查询分析器”中测试,可以这样
use master
go
create table test1(id int,name varchar(20))
create table [mytest].[dbo].[test3](id int,name varchar(20))
insert into test1(id,name) values(1,'')
insert into [mytest].[dbo].[test3](id,name) values(1,'张三')
select * from test1
select * from [mytest].[dbo].[test3]
update test1 set name=t3.name from [mytest].[dbo].[test3] t3 where test1.id=t3.id
select * from test1
但如果在在其他语言中运行,就不一样了,涉及到连接问题