James Ray Anderson

James Ray Anderson
James Ray Anderson
0 comments

Determine Process ID's in SQL Server and KILL them

2:40 PM
Need to perform a restore on your database?  Can't do it because it is in use?  Even if your websites and other sources are offline?  Open an query window and use the following:

SELECT 'KILL ' + CONVERT(nvarchar(3),spid)

FROM [master]..sysprocesses
WHERE DBID=DB_ID('DATABASE_NAME')

Copy the Results into another query window and execute to kill the ID's.

0 comments:

 
Toggle Footer
Top