Collation Error

后端 未结 3 1662
长发绾君心
长发绾君心 2021-02-01 13:36

I am using Microsoft SQL Server Management Studio. I have two databases one is the system database, which has the master database and the other one is my database called C

3条回答
  •  不要未来只要你来
    2021-02-01 14:36

    Here's the biggest hint to your problem:

    Msg 5030, Level 16, State 2, Line 1 The database could not be exclusively locked to perform the operation.

    What you need to do is set the database to single-user mode before you run the ALTER DATABASE statement, and then set it back to multi-user mode when it's completed. This will lock the database and make it available only to the current connection, which will allow you to successfully run the ALTER DATABASE ... COLLATE statement.

    You can use SQL Server Management Studio or T-SQL commands to do this.

提交回复
热议问题