In
this article I am going to explain how to Check Case-Sensitivity in SQL Server.
In
previous article I have explained how to create comma separated list in Sqlserver, how to encrypt store procedure, view and function in sql server and howto take database Backup and restore using command T-Sql.
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:
No comments:
Post a Comment