单用户模式恢复到多用户模式. mssql
USE master;
GO
DECLARE @SQL VARCHAR(MAX);
SET @SQL=''
SELECT @SQL=@SQL+'; KILL '+RTRIM(SPID)
FROM master..sysprocesses
WHERE dbid=DB_ID('cmistest');
EXEC(@SQL);
GO
ALTER DATABASE cmistest SET multi_user
USE master;
GO
DECLARE @SQL VARCHAR(MAX);
SET @SQL=''
SELECT @SQL=@SQL+'; KILL '+RTRIM(SPID)
FROM master..sysprocesses
WHERE dbid=DB_ID('cmistest');
EXEC(@SQL);
GO
ALTER DATABASE cmistest SET multi_user