Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
Mathias
Posting Yak Master
119 Posts |
Posted - 2011-02-21 : 07:19:02
|
I have a db with 100's of tables and have often collation issues. How can I find all table fields that are using a different collation than the base collation? |
|
Ifor
Aged Yak Warrior
700 Posts |
Posted - 2011-02-21 : 08:00:11
|
[code]USE YourDBGOSELECT *FROM INFORMATION_SCHEMA.COLUMNS CWHERE -- Check against database collation COLLATION_NAME <> DATABASEPROPERTYEX('YourDB', 'Collation') -- Check against instance collation -- COLLATION_NAME <> SERVERPROPERTY('Collation')[/code]If the instance collation is not the same as the DB collation, you should also ensure that character columns in temp tables/variables are declared with COLLATE DATABASE_DEFAULT. |
|
|
|
|
|