两种方案,自己选
------------------------------------------------------
declare @a table
(a int,
 b int)declare @b table
(a int,
b int)insert into @a
select 1,1
union all
select 2,2
union all
select 3,3
union all
select 4,4insert into @b
select 1,1
union all
select 2,2
union all
select 3,3
union all
select 4,4select * from @b
select * from @b where checksum(*) not in (select checksum(*) from @a)update @b
set b=5
where a=4
select * from @b
select * from @b where checksum(*) not in (select checksum(*) from @a)---------------------------------------------------------------------declare @a table
(a int,
 b int)declare @b table
(a int,
b int)insert into @a
select 1,1
union all
select 2,2
union all
select 3,3
union all
select 4,4insert into @b
select 1,1
union all
select 2,2
union all
select 3,3
union all
select 4,4select * from @b
select * from @b where checksum(*) not in (select checksum(*) from @a)
select * from @b b where not exists (select a,b from @a where a=b.a and b=b.b)
update @b
set b=5
where a=4
select * from @b
select * from @b where checksum(*) not in (select checksum(*) from @a)
select * from @b b where not exists (select a,b from @a where a=b.a and b=b.b)