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) A socialist is someone who will give you the shirt off *someone else's* back.

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

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