views:

32

answers:

2

Hello,

i aked myself if it is possible in MS SQL-Server 2005 to get information of a running stored procedure. Because meanwhile it is executing for more than 8 hours, i would like to know on what step it is or if it is even actually running at all. MS SSMS says that it is still executing the query.

Thanks in advance, Tim

A: 

Use Print statements?

Update a log table?

Beth
Ok, suggestions for logging in general are welcome too. But my problem/question at the time is: how to get informations on a currently executing stored procedure when nothing is manually printed or logged? Are there logs that i'm not aware of? I'm not a skilled ms sql-server admin.
Tim Schmelter
you mean it's not your sp and you can't modify it? you need a black box solution instead of white box?
Beth
I have changed an existing stored procedure and had to run it against the whole database after a major import. Normally it would only calculate and change new Data and is running every morning before a SSAS Cube rebuild. I already have changed it that it will send an email with informations about the results, but that will be send only after executing. Now i needed informations about the current process. But sql profiler was the hint i needed. Btw, my skills were developing db independently and now i have to learn a lot about ms sql server in deep ;)
Tim Schmelter
+3  A: 

sql Profiler can help you: http://www.databasejournal.com/features/mssql/article.php/3750161/Introduction-to-SQL-2005-Profiler-Part-1.htm

anishmarokey
Thanks. I knew there was a profiler but i didnt know that it is so practically. Anyway, the stored procedure is not listed in the stack trace. Does that mean that it's not executing anymore?EDIT: i have changed the template to 'TSQL_SPs' and now i'm seeing that it is stil running. Thanks again
Tim Schmelter
you are always welcome :)
anishmarokey