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
 General SQL Server Forums
 New to SQL Server Programming
 Capture Temp Table

Author  Topic 

Vack
Aged Yak Warrior

530 Posts

Posted - 2011-01-24 : 13:43:02
I'm trying to catch some data that gets generated by another program. When a report is ran a temp table is created by the program that the report uses.

Is there a way to have a trigger copy the data into another table automatically?

The name of the temp table is always different, it has a time stamp in the name.

Example: GbkmutOutStandingView_13842PM

Working with SQL 2005

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2011-01-24 : 14:14:35
Is it using a stored procedure?

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

Vack
Aged Yak Warrior

530 Posts

Posted - 2011-01-24 : 15:51:34
None that I can see.
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2011-01-24 : 15:53:06
There isn't really a way to do this then. A trigger gets launched for a DML statement, not for a SELECT. You could try to find the object in tempdb, however you wouldn't know when to query tempdb for it, so you'd have to constantly be querying tempdb and may miss it in between calls.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page
   

- Advertisement -