0

I'm looking to monitor a long running script in Sql Server 2008.

I'm searching for an equivalent of dbms_application_info in oracle. I want to set a status on the session during runtime and monitor using some kind of v$session table.

I know I can set up an event table but I thought that maybe there is a build in solution (though i highly doubt it having dealt with sql server for a while now).

haki
  • 9,389
  • 15
  • 62
  • 110
  • How about [`SET CONTEXT_INFO`](http://msdn.microsoft.com/en-us/library/ms187768.aspx) / [`CONTEXT_INFO`](http://msdn.microsoft.com/en-us/library/ms180125.aspx)? – stakx - no longer contributing Sep 16 '14 at 11:30
  • Or use a *temporary* status table -- either via a table variable `@table` (local to the batch), or as a temporary local table `#table` (local to the session). – stakx - no longer contributing Sep 16 '14 at 11:34
  • @stakk - i see that's it allow only binary data. I'm looking to set string, e.g "Stated loading data into fact..."; – haki Sep 16 '14 at 11:37
  • About the temporary table - wouldn't such table be accessible only to the process/session running the batch ? I'm looking to monitor the process from another session. – haki Sep 16 '14 at 11:38
  • 1
    In that case, you would want a global temporary table `##table`. See also [this answer](http://stackoverflow.com/a/2921091/240733) to the question, ["Local and global temporary tables in SQL Server"](http://stackoverflow.com/questions/2920836/local-and-global-temporary-tables-in-sql-server) for an explanation of the difference. – stakx - no longer contributing Sep 16 '14 at 11:57

0 Answers0