Connecting Tech Pros Worldwide Forums | Help | Site Map

How do you change the default encoding on SQL server?

Familiar Sight
 
Join Date: Sep 2008
Posts: 255
#1: Jul 28 '09
I'm wondering how you change the default encoding on SQL server and also how do you change the encoding on existing tables in a SQL DB?

Newbie
 
Join Date: Jun 2008
Posts: 25
#2: Jul 29 '09

re: How do you change the default encoding on SQL server?


Do you mean change the default collation for new databases? Change the collation of the model database:
Expand|Select|Wrap|Line Numbers
  1. USE [master]
  2. GO
  3. ALTER DATABASE [model] COLLATE [SomeNewCollation]
  4. GO
  5.  
Change the Collation for a single database:
Expand|Select|Wrap|Line Numbers
  1. USE [master]
  2. GO
  3. ALTER DATABASE [MyDB] COLLATE [MyNewCollation]
  4. GO
  5.  
Reply