Collation

  • Just restored a database from another site and running into all sorts of problems to do with Collation

    Is there any 'easy' way to just completely change Everything in a database to a specific collation

    e.g. Tables, Columns, Indexes, Constraints,. in other words everything

    Something like: Change Database MyDatabase to Collation Latin1_General_CI_AS

    (I cannot find a simple way to do this)

  • No easy way, if you want to change everything you need to script everything out and do a find replace and regenerate the database then reinsert the data.

    The alternative is to add the “COLLATE DATABASE_DEFAULT” option to everywhere to make sql pick a default or specify a particular collation on each reference to a table, join, view etc etc in each query you run.

  • Agree, there's no super-easy, "automatic" way to do that.  However, you can generate a script(s) that will change each column as needed, so it's not like you have to do it all by hand.

    SQL DBA,SQL Server MVP(07, 08, 09) Prosecutor James Blackburn, in closing argument in the Fatal Vision murders trial: "If in the future, you should cry a tear, cry one for them [the murder victims]. If in the future, you should say a prayer, say one for them. And if in the future, you should light a candle, light one for them."

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply