Question : how to stop a stored procedure

I think I have a strored proc running and I need to stop it.

However, I need:
1. List all procedures which are being executed right now.
2. Stop the required procedure.

Answer : how to stop a stored procedure

SELECT  s.spid, DatabaseName = DB_NAME(s.dbid),
        s.program_name, s.loginame, ObjectName = OBJECT_NAME(objectid, s.dbid),
        Definition = CAST(text AS VARCHAR(MAX))
FROM    sys.sysprocesses s
CROSS APPLY sys.dm_exec_sql_text(sql_handle)
WHERE   s.spid > 50



check in the "ObjectName" column for the sp name , the you can kill the curresponding SPID using the KILL statement in a new query window
Random Solutions  
 
programming4us programming4us