sql中:The database could not be exclusively locked to perform the operation. 错误处理

sql中:The database could not be exclusively locked to perform the operation. 错误处理

思路:先改成单用户模式,再改回来

 

示例:

ALTER DATABASE db01 SET SINGLE_USER WITH ROLLBACK IMMEDIATE

EXEC sp_rename 'db01', 'dbok' ,'database'

ALTER DATABASE dbok SET MULTI_USER

 

你可能感兴趣的:(sql中:The database could not be exclusively locked to perform the operation. 错误处理)