April 4, 2013 at 3:25 am
Dear All
In temp db i find many temp tables created. I would like to know which SPID has created these.
Is there a way to check this?
Regards
Krishna1
April 4, 2013 at 5:12 am
Not sure we can achive this. Better name your temptable with SPIDs.
sys.dm_db_session_space_usage will give you some details about temp tables' usage.
April 4, 2013 at 5:30 am
I am not creating the temp tables. but i still see few created automatically. Hence wahanted to know from where are they getting created
April 4, 2013 at 5:52 am
Short of profiling the instance, I don't think you can tell which session created which table. You can see the temp space that each session uses with the sys.dm_db_session_space_usage DMV.
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
April 9, 2013 at 3:24 pm
I suppose you COULD write a server level trigger to append the SPID to the table extended properties. Not sure how useful that would be.
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy