Mega Search
23.2 Million


Sign Up

Make a donation  
schema charset  
News Group: microsoft.public.sqlserver.server

Does anybody know how to determine which character set is currently used
in a database schema? I mean table names, column names, index names and
so on, not the values in a char column.

Is there a database or server option for this?

T.M.

Vote for best question.
Score: 0  # Vote:  0
Date Posted: 19-Jun-2013, at 9:40 AM EST
From: Torsten Mueller
 
Re: schema charset  
News Group: microsoft.public.sqlserver.server
Torsten Mueller (irrlicht67@gmx.ch) writes:
> Does anybody know how to determine which character set is currently used
> in a database schema? I mean table names, column names, index names and
> so on, not the values in a char column.
> 
> Is there a database or server option for this?

The *character set* is always Unicode. (Unless you are SQL 6.5 or older.)

The collation for the metadata - which controls case-sensitivity, sorting 
etc - is controlled by the database collation. If you did not specify a
collation when you created the database, the default is the server 
collation. You can view the collation for a database with this query:

   select collation_name from sys.databases where name = 'yourdb'

I should add that if you are using a contained database on SQL 2012, the 
collation is always one and the same, regardless of the database collation:
Latin1_General_100_CI_AS_KS_WS_SC if memory serves.



-- 
Erland Sommarskog, Stockholm, esquel@sommarskog.se

Vote for best answer.
Score: 0  # Vote:  0
Date Posted: 19-Jun-2013, at 10:20 PM EST
From: Erland Sommarskog