1. Forcing a column in the database to be changed to case -sensitive recognitionFor example, to modify a table: userPWD14 column in tb_testtable400
<span style= "FONT-SIZE:14PX;" >alter TABLE tb_testtable400alter COLUMN userPWD14 nvarchar (+) COLLATE chinese_prc_cs_as</span>
2. Specify in the SQL statement Case insensitive :
<span style= "FONT-SIZE:14PX;" >select * from tb_testtable400where userPWD14 = ' Vanny ' COLLATE chinese_prc_ci_as</span>
Case Sensitive:
<span style= "FONT-SIZE:14PX;" >select * from tb_testtable400where userPWD14 = ' Vanny ' COLLATE chinese_prc_cs_as</span>
3. Change the entire database to case-sensitive (after testing, do not know why no effect)
<span style= "FONT-SIZE:14PX;" >alter Database DatabaseName COLLATE chinese_prc_cs_as</span>
If the above statement performs the following error:
<span style= "FONT-SIZE:14PX;" > Msg 5030, Level 16, State 2, line 1th cannot lock the database with an exclusive lock to perform the operation. Msg 5072, Level 16, State 1, Row 1th, alter DATABASE failed. The default collation for database ' Test ' cannot be set to Chinese_prc_cs_ai. </span>
Restart the MSSQLServer service
Small bet: When you install SQL Server, you should consider how the sorting is done and whether the case distinguishes the details.
How SQL Server enforces case sensitivity