SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


How to change SQL Server Collation


How to change SQL Server Collation

Author
Message
sunilreddy
sunilreddy
Old Hand
Old Hand (383 reputation)Old Hand (383 reputation)Old Hand (383 reputation)Old Hand (383 reputation)Old Hand (383 reputation)Old Hand (383 reputation)Old Hand (383 reputation)Old Hand (383 reputation)

Group: General Forum Members
Points: 383 Visits: 381
I got the same problem...
The better way is to reinstall again and change the collation during the installation itself....

sunilreddy
http://msbimentalist.wordpress.com :-)
mosaic-287947
mosaic-287947
SSC Eights!
SSC Eights! (811 reputation)SSC Eights! (811 reputation)SSC Eights! (811 reputation)SSC Eights! (811 reputation)SSC Eights! (811 reputation)SSC Eights! (811 reputation)SSC Eights! (811 reputation)SSC Eights! (811 reputation)

Group: General Forum Members
Points: 811 Visits: 924
For a single database this codeproject solution (updated for SQL 2005) may still be worth a look:

http://www.codeproject.com/KB/database/ChangeCollation.aspx
dlangschied
dlangschied
SSC-Addicted
SSC-Addicted (403 reputation)SSC-Addicted (403 reputation)SSC-Addicted (403 reputation)SSC-Addicted (403 reputation)SSC-Addicted (403 reputation)SSC-Addicted (403 reputation)SSC-Addicted (403 reputation)SSC-Addicted (403 reputation)

Group: General Forum Members
Points: 403 Visits: 33
I tried this solution to change my collation from Latin1_General_CI_AS to SQL_Latin1_General_CP1_CI_AS and it did not work. I did not get any errors, but it did not work nonetheless. Please advise.
dlangschied
dlangschied
SSC-Addicted
SSC-Addicted (403 reputation)SSC-Addicted (403 reputation)SSC-Addicted (403 reputation)SSC-Addicted (403 reputation)SSC-Addicted (403 reputation)SSC-Addicted (403 reputation)SSC-Addicted (403 reputation)SSC-Addicted (403 reputation)

Group: General Forum Members
Points: 403 Visits: 33
To be precise, the solution of running the start ... settup.exe .. SQLCOLLATION=SQL_Latin1_General_CP1_CI_AS to rebuild the instance.
wgregalu
wgregalu
SSC Rookie
SSC Rookie (45 reputation)SSC Rookie (45 reputation)SSC Rookie (45 reputation)SSC Rookie (45 reputation)SSC Rookie (45 reputation)SSC Rookie (45 reputation)SSC Rookie (45 reputation)SSC Rookie (45 reputation)

Group: General Forum Members
Points: 45 Visits: 5
I had a SQL Server 2005 installation where the server was defined with Latin1_General_CI_AI and databases defined with SQL_Latin1_General_CP1_CI_AS (I didn't install it and don't know how it got that way). The client was receiving the "Cannot resolve the collation conflict between" error while accessing their application.

I detached the databases defined with the correct collation, shutdown SQL Server and associated services, ran

sqlservr -m -T4022 -T3659 -q"SQL_Latin1_General_CP1_CI_AS"

restarted the server and associated services, reattached the databases, and everything worked perfectly!

Startup option -m forces single user mode.
Trace flag 3659 allows logging all errors to SQL Server logs.
Trace flag 4022 forces SQL Server to skip startup stored procedures (if you have any).
Startup option -q rebuilds all databases and contained objects into the specified collation, without reinstalling the instance.

Per link: http://spaghettidba.com/tag/trace-flags/
Jamie Gaffney
Jamie Gaffney
SSChasing Mays
SSChasing Mays (611 reputation)SSChasing Mays (611 reputation)SSChasing Mays (611 reputation)SSChasing Mays (611 reputation)SSChasing Mays (611 reputation)SSChasing Mays (611 reputation)SSChasing Mays (611 reputation)SSChasing Mays (611 reputation)

Group: General Forum Members
Points: 611 Visits: 93
Old thread I too have been having problems with this in the future...
It Seems to run and not show any error messages...

Command i am running: Setup /ACTION=REBUILDDATABASE /INSTANCENAME=MSSQLSERVER /SQLSYSADMINACCOUNTS=ecljagaf /sapwd=Password /SQLCOLLATION=SQL_Latin1_General_CP1_CI_AS

I am running this from this directory: C:\Program Files\Microsoft SQL Server\100\Setup Bootstrap\Release

I have also tried mounting the drive and running the command from there.

any help would be appreciated.
Solomon Rutzky
Solomon Rutzky
SSChampion
SSChampion (12K reputation)SSChampion (12K reputation)SSChampion (12K reputation)SSChampion (12K reputation)SSChampion (12K reputation)SSChampion (12K reputation)SSChampion (12K reputation)SSChampion (12K reputation)

Group: General Forum Members
Points: 12722 Visits: 3354
What does the "sqlservr.exe -q" option do?

Short answer:

It changes the Collation at all levels: Instance, all Database's, and all string columns in all User Tables. It does this, and avoids all of the typical restrictions, by simply updating the meta-data of the tables, etc to have the new Collation. It then drops and recreates all indexes that have string columns. There are also a few nuances to this method that might have impact, but are fixable.

Long answer:

I have documented all of the behaviors, including listing all of the potentially affected areas by doing such a wide-sweeping Collation change, in the following post:

Changing the Collation of the Instance, the Databases, and All Columns in All User Databases: What Could Possibly Go Wrong?


Warning:

This option is undocumented (well, not "officially" documented), meaning: unsupported (use at your own risk ; it might work perfectly, but if it doesn't, Microsoft isn't going to help or be liable)

Take care, Solomon..


SQL# - https://SQLsharp.com/ ( SQLCLR library of over 340 Functions and Procedures)
Sql Quantum Lift - https://SqlQuantumLift.com/ ( company )
Sql Quantum Leap - https://SqlQuantumLeap.com/ ( blog )
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum








































































































































































SQLServerCentral


Search