日期:2014-05-16 浏览次数:20676 次
INSERT INTO [lwmain2].dbo.LWnhdd
( nh ,
dd ,
azwz ,
x ,
y ,
dwz ,
bm ,
sblb
)
SELECT nh ,
dd ,
azwz ,
x ,
y ,
dwz ,
bm ,
sblb
FROM [lwmain1].dbo.LWnhdd
WHERE [lwmain1].dbo.LWnhdd.nh NOT IN (SELECT [lwmain2].dbo.LWnhdd.nh FROM [lwmain2].dbo.LWnhdd)
---这样写
insert into lwmain2.dbo.LWnhdd(nh,dd,azwz,x,y,dwz,bm,sblb)
select nh,dd,azwz,x,y,dwz,bm,sblb from lwmain1.dbo.LWnhdd
where lwmain1.dbo.LWnhdd.nh not in(select nh from lwmain2.dbo.LWnhdd.nh)