×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: T-SQL
Posted by: Chris Di Carlo
Added: Jul 30, 2014 4:23 PM
Views: 12
Tags: no tags
  1. DECLARE @kill varchar(8000) = '';
  2. SELECT @kill = @kill + 'kill ' + CONVERT(varchar(5), spid) + ';'
  3. FROM master..sysprocesses
  4. WHERE dbid = db_id('MyDB')
  5.  
  6. EXEC(@kill);