Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
mihirvb84
Starting Member
11 Posts |
Posted - 2012-03-29 : 09:57:30
|
| How should I build 'Where Clause' to find email id having characters in Uppercase? I am using SQL server 2008. |
|
|
X002548
Not Just a Number
15586 Posts |
|
|
sunitabeck
Master Smack Fu Yak Hacker
5155 Posts |
Posted - 2012-03-29 : 10:17:43
|
To add to Brett's comment, if your collation is not case-sensitive and you still want to find rows where the email has capital letters, you can use a where clause such as this:WHERE CAST(email AS VARBINARY) <> CAST(LOWER(email) AS VARBINARY) |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2012-03-29 : 12:20:20
|
or force the collation to case sensitive one just for comparison using COLLATE clauseex:...WHERE email COLLATE SQL_Latin1_General_CP1_CS_AS <> LOWER(email) ------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
|
|
|