首页 > 代码库 > 转载 The database could not be exclusively locked to perform the operation(SQL Server 5030错误解决办法)

转载 The database could not be exclusively locked to perform the operation(SQL Server 5030错误解决办法)

SQL Server 5030错误解决办法

今天在使用SQL Server时,由于之前创建数据库忘记了设置Collocation,数据库中插入中文字符都是乱码,于是到DataBase的Options中修改Collocation,出现了The database could not be exclusively locked to perform the operation这个错误,无法修改字符集为Chinese_PRC_90_CI_AS。

解决办法找了很久才找到,如下:

1.执行SQL ALTER DATABASE db_database SET SINGLE_USER WITH ROLLBACK IMMEDIATE

修改为单用户模式

2.然后关闭所有的查询窗口,修改Options的Collocation属性为Chinese_PRC_90_CI_AS

3.执行SQL ALTER DATABASE db_database SET MULTI_USER

再修改为多用户模式

 

作者:Sunny Peng
出处:http://www.cnblogs.com/psunny/

转载 The database could not be exclusively locked to perform the operation(SQL Server 5030错误解决办法)