34,587
社区成员
发帖
与我相关
我的任务
分享
insert into b.test select * from a.[user]
insert into servername.dbo.b.test select * from servername.dbo.a.user
use b
insert into test(a,b...字段)
select a,b...字段 from a.dbo.test
b的TEST 字段
和SELECT a 的字段必须对应
如果只将a库中user表的几个字段导入到b库中test表中的几个字段呢,应该怎么写
对应写字段如:ID , ID , VAL , VAL
insert into servername.dbo.b.test(id , val) select id , val from servername.dbo.a.user
如果字段名字不同如: aid , bid , aval , bval
insert into servername.dbo.b.test(bid , bval) select aid , aval from servername.dbo.a.user