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.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 Dynamic Temp Table

Author  Topic 

Da_Retina
Posting Yak Master

109 Posts

Posted - 2001-09-19 : 06:22:30
Hi..
Thanks IN Advance..
I am writing this code in an audit trail trigger:
SELECT * INTO #TempDeleted FROM deleted
SET @SelectStr = N'Select * into ' + @DelTempTableName + ' from #TempDeleted'
EXECUTE sp_executesql @SelectStr
Set @SelectStr = 'DROP TABLE #TempDeleted'
EXECUTE sp_executesql @SelectStr
IT IS NOT WORKING!!...by tracing I discovered the the DROP TABLE #TEMPDELETED is causing the problem..anyone have any clue why??
Thanks again

   

- Advertisement -