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
 SQL Server 2008 Forums
 Transact-SQL (2008)
 SQL LIKE SYNTAX

Author  Topic 

Blessed1978
Yak Posting Veteran

97 Posts

Posted - 2014-03-17 : 20:20:19
SQL THAT SHOWS PERSONS THAT DONT HAVE THE FIRST LETTER OF THEIR LAST NAME CAPITALIZED

nagino
Yak Posting Veteran

75 Posts

Posted - 2014-03-17 : 21:00:18
WHERE LOWER(LEFT([LAST NAME], 1)) = LEFT([LAST NAME], 1) COLLATE Latin1_General_BIN2


-------------------------------------
From Japan
Sorry, my English ability is limited.
Go to Top of Page

Lamprey
Master Smack Fu Yak Hacker

4614 Posts

Posted - 2014-03-18 : 11:50:40
If you wanted syntax for a LIKE comparison here is one way:
WHERE LastName NOT LIKE '[A-Z]%' COLLATE Latin1_General_BIN2
Go to Top of Page

Lamprey
Master Smack Fu Yak Hacker

4614 Posts

Posted - 2014-03-18 : 11:50:45
If you wanted syntax for a LIKE comparison here is one way:
WHERE LastName NOT LIKE '[A-Z]%' COLLATE Latin1_General_BIN2
Go to Top of Page

ScottPletcher
Aged Yak Warrior

550 Posts

Posted - 2014-03-18 : 12:11:14
More specifically:

WHERE LastName COLLATE Latin1_General_BIN2 LIKE '[a-z]%' COLLATE Latin1_General_BIN2
Go to Top of Page
   

- Advertisement -