We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1c32d26 commit 1bdff1bCopy full SHA for 1bdff1b
modules/C4B-Environment/C4B-Environment.psm1
@@ -540,6 +540,9 @@ function Add-DatabaseUserAndRoles {
540
USE [master]
541
IF EXISTS(SELECT * FROM msdb.sys.syslogins WHERE UPPER([name]) = UPPER('$Username'))
542
BEGIN
543
+DECLARE @kill varchar(8000) = '';
544
+SELECT @kill = @kill + 'kill ' + CONVERT(varchar(5), session_id) + ';' FROM sys.dm_exec_sessions WHERE UPPER([login_name]) = UPPER('$Username')
545
+EXEC(@kill);
546
DROP LOGIN [$Username]
547
END
548
0 commit comments