if exists ( select 1 from sysobjects where id = object_id ( ' newtable1 ' ) and type = ' U ' ) begin drop table newtable1 -- 用来存放所有子集ID的临时表 end