Management Studio

Find Collations For Your SQL Instance And The Databases

Here’s some sql logic to get the SQL Server Collation ( Instance Collation ), and the Database Collation.

use master;
set nocount on

declare	@mydatabasename		varchar(255)
set		@mydatabasename		= 'msdb'  -- I'm using MSDB as an example

	'server name'			= serverproperty('servername')
,	'server collation'		= convert(varchar, serverproperty('collation'))
,	'database name'			= @mydatabasename
,	'database collation'	= databasepropertyex(@mydatabasename, 'collation');

Here’s a quick screenshot.



Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s