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.
|
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
|