我的一个数据库处于单用户模式,我似乎无法将其切换到多用户模式。
USE master
GO
ALTER DATABASE MyDB
SET MULTI_USER WITH ROLLBACK IMMEDIATE
GO当我运行上面的查询时,我得到了以下结果
Changes to the state or options of database 'MyDB' cannot be made at this time. The database is in single-user mode, and a user is currently connected to it.我曾尝试从主数据库中查询SQL Server,以查找到MyDB (exec sp_who)的所有活动连接,但当我这样做时,我得到了以下错误
Database 'MyDB' is already open and can only have one user at a time.我应该怎么做才能退出单用户模式?
发布于 2014-06-09 18:40:09
使用以下命令:
exec sp_dboption 'db_name_here', 'single user', 'FALSE'https://stackoverflow.com/questions/24118489
复制相似问题