Posted in Community :
Database Administration
|
|
||
|
Activity:
0 comments
203 views
last activity : 10 09 2010 05:22:43 +0000
|
||
|
|
DECLARE ...v_spid INT
DECLARE c_Users CURSOR
FAST_FORWARD FOR
SELECT SPID
FROM master..sysprocesses (NOLOCK)
WHERE spid>50
AND status='sleeping'
AND DATEDIFF(mi,last_batch,GETDATE())>=60
AND spid<>......spid
OPEN c_Users
FETCH NEXT FROM c_Users INTO ...v_spid
WHILE (......FETCH_STATUS=0)
BEGIN
PRINT 'KILLing '+CONVERT(VARCHAR,...v_spid)+'...'
EXEC('KILL'+...v_spid)
FETCH NEXT FROM c_Users INTO ...v_spid
END
CLOSE c_Users
DEALLOCATE c_Users
0 comments on "kill all sleeping process in ms sql"
Sort by:
Most Recent
Top Rated
Found the article
"kill all sleeping process in ms sql"
interesting ?
Share with your connections and communities
Viewers also viewed
|
|
|
|
|
|
Recent Knowledge (88)
|
|
|
|
|
|
Sponsored Jobs
More From Author
While installing payment gateway on windows server with java. its useful. |
Tips for avoid sleepiness During the Day at work |
After deciding on a property,the next big thing one does is to look for a good home loan. While people think that there is no big deal in getting a home loan with Bank waiting in queue to offer home loans. getting home loan is very difficult. |
