DECLARE @SQL VARCHAR(MAX);
SET @SQL=‘‘
SELECT @[email protected]+‘; KILL ‘+RTRIM(SPID)
FROM master..sysprocesses
WHERE dbid=DB_ID(‘数据库名‘);
EXEC(@SQL);
时间: 2024-10-29 17:01:32
DECLARE @SQL VARCHAR(MAX);
SET @SQL=‘‘
SELECT @[email protected]+‘; KILL ‘+RTRIM(SPID)
FROM master..sysprocesses
WHERE dbid=DB_ID(‘数据库名‘);
EXEC(@SQL);