Friday, April 24, 2009

View SQL Server Database Columns Collations that different from Database

Execute the code below to find out which columns have different collation.




SELECT TABLE_SCHEMA, TABLE_NAME, COLUMN_NAME, COLLATION_NAME FROM information_schema.columnsWHERE COLLATION_NAME IN (SELECT DISTINCT COLLATION_NAME FROM INFORMATION_SCHEMA.COLUMNSEXCEPT(SELECT DATABASEPROPERTYEX('sds', 'Collation')UNION ALLSELECT NULL))

No comments:

Post a Comment

 
span.fullpost {display:inline;}