Sql server 2005 change collation for database

Collation is a set of rules how to compare and sort data in a database.Changing database collation may cause some problems especially:

Error-5030 The database could not be exclusively locked to perform the operation.

To resolve this problem you should do the following from command line:

–Uses a trusted connection instead of requesting a password.

C:\>osql -E
1>use djbadmin
2>GO

–Specifies that only one user can connect to the database at a time. By rolling back other connected users immediately.

1>ALTER DATABASE djbadmin SET SINGLE_USER WITH ROLLBACK IMMEDIATE
2>GO

–Changes collation for database to Latin1_General_CI_AS

1>ALTER DATABASE djbadmin COLLATE Latin1_General_CI_AS
2>GO

–Returns database to its usual state(Available for multiple users).

1>ALTER DATABASE djbadmin SET MULTI_USER
2>GO
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: