Ö´ÐÐÏÂÃæÒ»¶Î´úÂ룺 declare @sql varchar(1000) set @sql = 'select identity(int,1,1) as tbId,* into #tb1 from ex091214 where 1=0' exec(@sql) select * from #tb1 --Öм仹ÐèÒªÓõ½#tb1 drop table #tb1
set @sql = 'insert #tb1(...) select identity(int,1,1) as tbId,* from ex091214 where 1=0' exec(@sql) select * from #tb1 --Öм仹ÐèÒªÓõ½#tb1 drop table #tb1
££££££¾££££
¸ã³ÉÁ½¸ö SQL code: declare @sql varchar(1000) set @sql = 'select identity(int,1,1) as tbId,* into #tb1 from ex091214 where 1=0; select * from #tb1; drop table #tb1' exec(@sql)
declare @sql varchar(1000) set @sql = 'select identity(int,1,1) as tbId,* into #tb1 from ex091214 where 1=0 select * from #tb1 drop table #tb1' exec(@sql)