Created
March 16, 2018 21:25
-
-
Save akramarev/e4630ab43484e49abd9e6aec54d60bea to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DECLARE @kill varchar(8000) = ''; | |
SELECT @kill = @kill + 'kill ' + CONVERT(varchar(5), session_id) + ';' | |
FROM sys.dm_exec_sessions | |
WHERE | |
database_id = db_id('DBUser') | |
AND login_name IN ('DBTest', 'DBServices') | |
EXEC(@kill); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment