DECLARE @d VARCHAR(8000)
SET @d = ' '
SELECT
@d = @d + ' kill ' + CAST(spid AS VARCHAR) + CHAR(13)
FROM
MASTER.sys.sysprocesses
WHERE
dbid = DB_ID('ATMS ')
EXEC (@d)
DECLARE @d VARCHAR(8000)
SET @d = ' '
SELECT
@d = @d + ' kill ' + CAST(spid AS VARCHAR) + CHAR(13)
FROM
MASTER.sys.sysprocesses
WHERE
dbid = DB_ID('ATMS ')
EXEC (@d)