Discussion in 'General DBA Questions' started by pcsql, Jul 29, 2004.
Is there a way to find out which application creates a particular temporary table?
A Profiler Trace will tell you. You will see which application is creating the temp table, along with the name of the table being created.
Brad M. McGehee, MVP
I think I'm not clear enough. I wonder whether there is a way to find out which application creates a particular temporary table "After" the table has been created. I can find out all the temporary tables created from tempdb..sysobjects but I don't know how to tell which application creates which temporary tables. I want to able to distinguish temporary tables which have same name but they are created by different applications.
Then he was right. You need to use Profiler. There's nothing builtin to SQL Server that tells you this after the fact. You could also review all stored procs and inline code to identify where they're being created.
When life gives you a lemon, fire the DBA.
Well, I just hope there is some undocumented place to hold this kind of info. If the process id which used to create the table is stored somewhere, it will be good enough.[<img src='/community/emoticons/emotion-1.gif' alt='' />]<br /><br /><br />Thank you for your help.
I believe this is handled by SQL Engine in order to create the temp tables and as specified PROFILER is only monitoring tool to findout the sequence.
This posting is provided â€œAS ISâ€ with no rights for the sake of knowledge sharing.
Separate names with a comma.