Yesup
 
 

Yamabay Knowledge Base

 

How to change the Collation of a Database in SQL Server 2000

Previous Article Back to TOC Next Article

The default collation of a database is inherited from the default collation of the instance of the SQL Server. In most cases, it is:


SQL_Latin1_General_CP1_CI_AS

If you want to change it to, say, case sensitive one:

Latin1_General_BIN

You have to set the database in single user mode first:

ALTER DATABASE myDatabase SET SINGLE_USER WITH ROLLBACK IMMEDIATE
ALTER DATABASE myDatabase COLLATE Latin1_General_BIN
ALTER DATABASE myDatabase SET MULTI_USER

Please note that changing the colaltion of the database will NOT change the collation of the columns that are already in the tabase, only the default collation of any new columns you will create in the future.

However, changing the database collation will affect the Identifier's case sensitivity right away. The identifiers include Tables Names and Field Names. If you change the Collation to Latin1_General_Bin, you have to specify the Field Names and Tables Names in case sentitive way when writing T-SQL statements.

Yesup
Top Stories Travel Movies Gift Ideas Free Software Games