Steve (mu******@hotmail.com) writes:
I have a query which filters records containing uppercase and
Lowercase i.e.
Smith and SMITH, Henderson and HENDERSON etc.
Is there a way that I can filter only those records that contain the
first uppercase letter and the remaining lowercase letters for my
query i.e. Smith , HENDERSON etc.
You can do this (example runs in Northwind):
SELECT *
FROM Customers
WHERE CompanyName COLLATE Latin1_General_BIN LIKE '[A-ZÀ-Ý]%'
AND CompanyName COLLATE Latin1_General_BIN NOT LIKE '_%[A-ZÀ-Ý]%'
The requirements is somewhat relaxed here. You will actually get
hits for "J1234" or "D....". Depending on your data, this may or
may not help.
Please note that it is not likely that SQL Server will use an index
for this search.
--
Erland Sommarskog, SQL Server MVP,
so****@algonet.se
Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp