Change collation.

How do I change the collation of my database from Latin1_General_CI_AS to SQL_Latin1_General_CP1_CI_AS.
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Imran Javed ZiaConsultant Software Engineer - .NET ArchitectCommented:
you can use
/SQLSYSADMINACCOUNTS=accounts /[ SAPWD= StrongPassword ]

You may find following articals helpful
Mr_ShawAuthor Commented:
This change is for my local instance of SQL Server 2005.

I have tried:


But i get an error reading

Incorrect syntax near '/'.
Daniel_PLDB Expert/ArchitectCommented:
Do not rebuild system databases. You will lose all settings!!!
USE master
ALTER DATABASE <yourdbname> COLLATE SQL_Latin1_General_CP1_CI_AS

Open in new window

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
The 7 Worst Nightmares of a Sysadmin

Fear not! To defend your business’ IT systems we’re going to shine a light on the seven most sinister terrors that haunt sysadmins. That way you can be sure there’s nothing in your stack waiting to go bump in the night.

Daniel_PLDB Expert/ArchitectCommented:
Additionally when you need to change default server collation there's no other way than rebuilding all system databases but when you only need to change collation for your database just change its COLLATE property as I posted above. You are able to keep your settings but it's a lot more to do than just changing colaltion for user database.
Mr_ShawAuthor Commented:
thanks Daniel PL.

I ran you script and got the following error:

The database could not be exclusively locked to perform the operation.
Msg 5072, Level 16, State 1, Line 1
ALTER DATABASE failed.The default collation of database 'DBName' cannot be set to SQL_Latin1_General_CP1_CI_AS.
Daniel_PLDB Expert/ArchitectCommented:
You have connections in that database.
You can either kill all sessions one by one or set database to either sigle user or restricted user mode:

Mr_ShawAuthor Commented:
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft SQL Server 2008

From novice to tech pro — start learning today.