Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
iswan
Starting Member
28 Posts |
Posted - 2007-07-23 : 10:16:35
|
create temp table using exec:set str='create table #scDataImportTest(ChapterNo varchar(150),FigureNo varchar(50))'exec(str)select * from #scDataImportTestError: Invalid obj #scDataImportTestBut If I am creating a physical table using this. It is creating correctlyset str='create table scDataImportTest(ChapterNo varchar(150),FigureNo varchar(50))'exec(str)select * from scDataImportTestI just removed the '#' from the query. It is working fine. I don't know How to create Temporary table using this execRegardsIswan |
|
blindman
Master Smack Fu Yak Hacker
2365 Posts |
Posted - 2007-07-23 : 10:48:08
|
Temporary tables exist only within the scope of the transaction, unless they are declared to be global. EXEC statements execute within their own scope, so temporary tables created by them vaporize when the statement completes. You could try bundling your SELECT clause in your EXEC string.e4 d5 xd5 Nf6 |
 |
|
|
|
|