Create Table T001
(
A Varchar(10)
)
Create Table T002
(
A Varchar(10)
)
Create Table T003
(
A Varchar(10)
)
Create Table T004
(
A Varchar(10)
)
insert into T001 values('A'),('B')
insert into T002 values('B'),('C')
insert into T003 values('C'),('D')
Exec sp_MSforeachtable @command1="Insert into T004 select * from ? except select * From T004 ",@whereand=" And o.name in('T001','T002','T003')"
--T004改成你的009表,in里面填你的001到008的表,就ok了