1
kudos
spam Kudos Remove

Another use for the Default Trace: Mapping Temporary Tables to Sessions

published 851 days, 23 hours, 56 minutes ago posted by sasa 861 days, 1 hour, 6 minutes ago
Thursday, October 08, 2009 2:42:39 PM GMT Tuesday, September 29, 2009 1:32:49 PM GMT

Here’s another use for the information captured by the default trace.  Ever wonder what session created the tables that exist in tempdb?  Well you can find it using the default trace and the sys.objects view in tempdb.  Any time an object is created in a database, EventClass 46 (Object:Created) is captured in the trace output of the DMV.  By scanning the trace files for a matching ObjectID that was created 100 ms before or after the objects create_date with DatabaseID = 2 (tempdb) you can match the objec...

category: Management | clicked: 1 | | source: sqlblog.com | show counter code
tags: Database Administration, Miscellaneous, Transact-SQL

No comments yet, be the first one to post comment.

To post your comment please login or signup