Update Collation of all fields in database on the fly

后端 未结 8 1731
说谎
说谎 2020-12-07 21:00

We recently moved our database from our SQL Server 2005 server to our SQL Server 2008 server. Everything moved over fine, however now we are finding that we are getting col

8条回答
  •  广开言路
    2020-12-07 21:37

    You can change the collation of any new objects that are created in a user database by using the COLLATE clause of the ALTER DATABASE statement. This statement does not change the collation of the columns in any existing user-defined tables. These can be changed by using the COLLATE clause of ALTER TABLE.

    Reference: Setting and Changing the Database Collation

    If there are too many columns, you can loop through SYS.COLUMNS to apply the ALTER TABLE statement.

提交回复
热议问题