Sunday, March 25, 2012

Changing all existing tables collations in one step

If you're wanting to change the whole collation of your database then
(in SQL 2000) the best way is to script out the db, recreate it with
the new collation as default, then DTS your data across. I think that
if you changed it table by table then every new table you create will
then have to be changed as well.
Hopefully there's something in SQL 2005 that allows a complete db
collation change, as I expect most people have run into the issue of a
database being restored from a backup from a server that used a
different collation (I often found for some reason the collation got
set to LATIN1_GENERAL_CPL_CI_AS on peoples default install of SQL for
no apparent reason).Thank you.
"Will" wrote:

> If you're wanting to change the whole collation of your database then
> (in SQL 2000) the best way is to script out the db, recreate it with
> the new collation as default, then DTS your data across. I think that
> if you changed it table by table then every new table you create will
> then have to be changed as well.
>
> Hopefully there's something in SQL 2005 that allows a complete db
> collation change, as I expect most people have run into the issue of a
> database being restored from a backup from a server that used a
> different collation (I often found for some reason the collation got
> set to LATIN1_GENERAL_CPL_CI_AS on peoples default install of SQL for
> no apparent reason).
>

No comments:

Post a Comment