Search This Blog

08 September 2010

Query to get Collation of database and columns of a table

To get dafault collation of database
1 - SELECT DATABASEPROPERTYEX('GoldenTours', 'Collation')
2 - SELECT collation_name FROM sys.databases WHERE name = 'GoldenTours'

Query to get Collation of all the columns of a table
SELECT name, collation_name
FROM sys.columns
WHERE OBJECT_ID IN ( SELECT OBJECT_ID FROM sys.objects
WHERE type = 'U'
AND name = 'categorydesc')

No comments:

Post a Comment