set @SQL=('SELECT * into #temp FROM TableName; SELECT * FROM #TEMP')
exec(@SQL)
or
set @SQL=('SELECT * into ##temp FROM TableName')
select * from ##temp
Drop Table ##temp
or
CREATE TABLE #temp (iid int, strName varchar(100), strAge varchar(100), str varchar(100), strTitle varchar(100))
exec('insert into #temp SELECT * FROM tbl_XML_Test')
select * from #temp
drop table #temp
Note: we can, t use table variable instead of temp table for above query.
exec(@SQL)
or
set @SQL=('SELECT * into ##temp FROM TableName')
select * from ##temp
Drop Table ##temp
or
CREATE TABLE #temp (iid int, strName varchar(100), strAge varchar(100), str varchar(100), strTitle varchar(100))
exec('insert into #temp SELECT * FROM tbl_XML_Test')
select * from #temp
drop table #temp
Note: we can, t use table variable instead of temp table for above query.
No comments:
Post a Comment