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
Need to set it to SINGLE_USER first.
ALTER DATABASE [database] SET SINGLE_USER WITH ROLLBACK IMMEDIATE;
GO
ALTER DATABASE [database] COLLATE SQL_1xCompat_CP850_CI_AS;
GO
ALTER DATABASE [database] SET MULTI_USER;
GO
Work perfectly Thank you alot
ALTER DATABASE [database] SET SINGLE_USER WITH ROLLBACK IMMEDIATE;
GO
ALTER DATABASE [database] COLLATE SQL_1xCompat_CP850_CI_AS;
GO
ALTER DATABASE [database] SET MULTI_USER;
GO
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.