SQL Server Varchar Chinese garbage problem using SQL Server Management Studio management software, check out the Field Limits

Question: whether it is a varchar or nvarchar, insert record for the Chinese, will be garbled? ?
Even if the language specified for a field when construction of the table is useless COLLATE Chinese_PRC_CS_AS_WS

The reason: It may be the installation configuration did not choose Chinese

Solution: Add the value N before inserting
insert into tableA (a) values ( N ' Chinese')

Recommendation: Use nvarchar save the Chinese, because the Chinese hold some special font data to varchar will continue to appear? ? If it is nvarchar special Chinese fonts can be saved successfully.

Use SQL Server Management Studio manage, execute a query data have length restrictions

 

Guess you like

Origin www.cnblogs.com/caiyt/p/11274960.html
Recommended