SQL SERVER – Find Collation of Database and Table Column Using T-SQL

Today we will go over very quick tip about finding out collation of database and table column. Collations specify the rules for how strings of character data are sorted and compared, based on the norms of particular languages and locales

Today’s script are self explanatory so I will not explain it much.

/* Find Collation of SQL Server Database */
SELECT DATABASEPROPERTYEX('AdventureWorks', 'Collation')
GO
/* Find Collation of SQL Server Database Table Column */
USE AdventureWorks
GO
SELECT name, collation_name
FROM sys.columns
WHERE OBJECT_ID IN (SELECT OBJECT_ID
FROM sys.objects
WHERE type = 'U'
AND name = 'Address')
AND
name = 'City'

SQL SERVER - Find Collation of Database and Table Column Using T-SQL findcollation

Reference : Pinal Dave (https://darkslategrey-bat-805937.hostingersite.com)

Database, SQL Collation, SQL Scripts, SQL Server Management Studio
Previous Post
SQLAuthority News – Wedding Day of Author – Photographs – Mr. and Mrs. SQLAuthority
Next Post
SQL SERVER – Interesting Interview Questions – Revisited

Related Posts

Leave a Reply