且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

使sql server数据区分大小写

更新时间:2022-12-18 07:48:22

此查询的结果取决于您选择的排序规则的类型.
默认情况下,它不区分大小写(CI).
您可以在数据库级别或特定列上进行更改.
看看这些文章:
http://msdn.microsoft.com/en-us/library/ms184391.aspx [ ^ ]
http://msdn.microsoft.com/en-us/library/ms144260.aspx [ ^ ]
Result of this query depends on the type of collation you have chosen.
By default it''s case insensitive (CI).
You can change it on database level or on specific column.
Take a look at these articles:
http://msdn.microsoft.com/en-us/library/ms184391.aspx[^]
http://msdn.microsoft.com/en-us/library/ms144260.aspx[^]


where username=@username COLLATE SQL_Latin1_General_CP1_CS_AS

>

这将比较username列和传入的@username参数的情况.



This will compare the case of username column and the @username parameter being passed in.