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.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Email-IDs having characters in Uppercase

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

Posted - 2012-03-29 : 10:08:23
what's your collation? case sensitive? if not, there are no worries.

Do you want them all as lower case?

UPDATE TABLE SET Col = LOWER(Col)



Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx


Want to help yourself?

http://msdn.microsoft.com/en-us/library/ms130214.aspx

http://weblogs.sqlteam.com/brettk/

http://brettkaiser.blogspot.com/


Go to Top of Page

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)
Go to Top of Page

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 clause

ex:


...
WHERE
email COLLATE SQL_Latin1_General_CP1_CS_AS
<> LOWER(email)


------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
   

- Advertisement -