How to see progress of running SQL stored procedures?
If you use RAISERROR
with a severity of 10 or less, and use the NOWAIT
option, it will send an informational message to the client immediately:
RAISERROR ('Deleting old data Part 1/3' , 0, 1) WITH NOWAIT
Check if stored procedure is running
You might query sys.dm_exec_requests
which will provide sesion_ID, waittime and futher rows of interest and CROSS APPLY sys.dm_exec_sql_text
filtering your query with the SQL for your procedure.
Select * from
(
SELECT * FROM sys.dm_exec_requests
where sql_handle is not null
) a
CROSS APPLY sys.dm_exec_sql_text(a.sql_handle) t
where t.text like 'CREATE PROCEDURE dbo.sp_sleeping_beauty%'
Check if a stored proc is running?
I asked this once :)
Check out:
Sql Server 2000 - How can I find out what stored procedures are running currently?
Related Topics
Sql: How to Find Duplicates Based on Two Fields
Removing Duplicates from SQL Join
How to Solve "Either the Parameter @Objname Is Ambiguous or the Claimed @Objtype (Column) Is Wrong."
Why Would a SQL Query Have "Where 1 = 1"
Oracle - Best Select Statement for Getting the Difference in Minutes Between Two Datetime Columns
Rails Virtual Attribute Search or SQL Combined Column Search
How to Change the Collation of SQLite3 Database to Sort Case Insensitively
How to Write a Function in the H2 Database Without Using Java
Error Detection from Powershell Invoke-Sqlcmd Not Always Working
How to Document Your Database Structure
How to Use Count() and Distinct Together
Return Value from a Stored Proc on Error
What SQLite Column Name Can Be/Cannot Be
What Column Should the Clustered Index Be Put On
Assigning a Variable Inside an If Exists Clause