Hello...
When I migrated data from one SQL Server to another I got collection problems because collation of the target server was different from the source one.
The best solution I thought about was to change collation of the database in target server to be equal to the server collation so that when a temporary table is created, and the collation used would be the server collation, no error would occur. All sounds logic, but, after I ran ALTER DATABASE command and changed the collation of the database, I verified that all varchar fields of all database tables retained the old collation, not the new database collation I set.
Is there any way to change the collation of all fields at once when I change the database collation?
Thanks for your help
Jaime
All that happens when you execute the ALTER DATABASE statement is that you set the NEW default for any NEW tables.
If you want to change the existing tables, you will have have to change each (n)varchar and text column -one at a time.
ALTER TABLE MyTable
ALTER COLUMN MyColumn COLLATE NewCollation
No comments:
Post a Comment