SQL Server Performance

Which app creates temporary table?

Discussion in 'General DBA Questions' started by pcsql, Jul 29, 2004.

  1. pcsql New Member

    Is there a way to find out which application creates a particular temporary table?

  2. bradmcgehee New Member

    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
  3. pcsql New Member

    Hi Brad,

    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.

  4. derrickleggett New Member

    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.
  5. pcsql New Member

    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.
  6. satya Moderator

    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.

    Satya SKJ
    This posting is provided “AS IS” with no rights for the sake of knowledge sharing.

Share This Page