TempDB and User DBs

  • Hi,

    I have three DBs in my server. (DB1, DB2, DB3)

    In these three DBs, there are procs that has temp tables in it.

    When all these DBs are Online and procs in all these DBs execute simultaneously, Is it possible to track down which temp table belongs which DB and procedure.

    Thanks in advance.

    "I Love Walking In The Rain So No One Can See Me Crying ! " ~ Charlie Chaplin

  • First I'd be interested in why you need to know this. Then I'd say, I don't think there is any way to determine this as temp tables are confined to a session and created in tempdb. You could query sys.tables in tempdb, but that isn't going to tell you what process created the table(s).

  • "You could query sys.tables in tempdb, but that isn't going to tell you what process created the table(s). " ..

    This is what i need that you have mentioned .. Is there any way other than sys.tables to find the process that created the table .. The reason why i ask this qn is tempDB gets fulled when all these three process happens .. I need to find which is causing this issue..

    P.N: Condition: All three DBs runs simultaneously and cant be run individually...

    Thanks in advance.

    "I Love Walking In The Rain So No One Can See Me Crying ! " ~ Charlie Chaplin

  • The only way I know of to do something like this is to set up a server-side trace that will show the SQL Statements and autogrow events.

  • Fine .. Lemme check with that..

    Thanks

    "I Love Walking In The Rain So No One Can See Me Crying ! " ~ Charlie Chaplin

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply