Check Case-Sensitivity in SQL Server | ASPMANTRA | Asp.Net,MVC,AngularJs,Jquery,Javascript,Sql Server AND WCF snippets and tutorial

Check Case-Sensitivity in SQL Server

In this article I am going to explain how to Check Case-Sensitivity in SQL Server.


Description:
SQL server determines case sensitivity by collation. COLLATE is the T-SQL clause used to specify a particular collation for an expression. We can use this to validate the users enter password at the time of login.

Syntax
select * from tablename where column_name='string' COLLATE SQL_Latin1_General_CP1_CS_AS

Example:
Create table #test
(
id int,
name varchar(50)
)

insert into #test(id,name) values(1,'vijay'),(2,'Amit'),(3,'JOHN')

Select * from #test where name ='vijay' COLLATE SQL_Latin1_General_CP1_CS_AS


Output:

Check Case-Sensitivity in SQL Server


Check Case-Sensitivity in SQL Server


Post a Comment

[blogger]

MKRdezign

Contact Form

Name

Email *

Message *

Powered by Blogger.
Javascript DisablePlease Enable Javascript To See All Widget