How to set database encoding by default?

How to set the standard encoding of a local server SQL server database?

Thanks.

EDIT: Removed UTF-8

+4
source share
3 answers

Assuming you mean sorting when encoding, you can change the default value for new databases, for example:

alter database model collate SQL_Latin1_General_CP1_CI_AS 

Change the sorting of an existing database:

 alter database YourDbName collate SQL_Latin1_General_CP1_CI_AS 

The list of available mappings is returned by the system function:

 select * from fn_helpcollations() 
+5
source

SQL Server does not support UTF-8.

Use nvarchar (UTF-16) if you don't mind using double space or varbinary if you don't need sorting / indexing / comparison.

It may be supported in the next version of SQL Server according to this post.

0
source
 /*!40101 SET NAMES utf8 */ 

Something like that

-3
source

All Articles