change collation of DB SQL Server 2008

▼魔方 西西 提交于 2019-12-11 11:58:24

问题


I have created some new databases in SQL Server 2008 Express (10.0.1600.22) and I have also restored one from SQL Server 2005 Express (9.00.1399.06).

The collations for these are different and I cannot execute queries across them as a result. So I am trying to change the restored database collation

from: SQL_Latin1_Genral_CP1_CI_AS
to:   Latin1_General_CI_AS

However the new collation does not appear in the list of options. Not sure if this is possible.

BTW - workarounds that are not options:

  • I cannot script the data from sql server 2005 express (it seems - I may be missing something)

  • I cannot script the DB on 2K8 server as I get an out of memory exception when doing that :-(


回答1:


If the collation is visible for other databases on your instance but not this specific one restored from a 2005 instance I wonder if the list displayed is dependent upon the databases compatibility model.

Maybe try changing the compatibility mode of the restored database to 100 to see if it appears in the list of options.

Note changing the database collation will not affect existing columns. Here's a script that may help with that.



来源:https://stackoverflow.com/questions/4991699/change-collation-of-db-sql-server-2008

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!