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
 Upper Function in Where Clause

Author  Topic 

d3ng
Yak Posting Veteran

83 Posts

Posted - 2008-01-29 : 20:13:24
Hi expert, I would like to ask regarding the UPPER function in SQL Query. I was tryin' to create a scipt that will give me a result of all the names that are in UPPER case format, but when I tried to execute the script the result is not right, it also retrieves all the records that are in PROPER case.

SQL Script:
SELECT id, name FROM table_1 WHERE UPPER(name) LIKE 'DAR%'

Result:
ID NAME
-- -------
1 Darren
2 DARREN

avmreddy17
Posting Yak Master

180 Posts

Posted - 2008-01-29 : 22:34:57
SQL Server By default is case insensitive.
Go to Top of Page

Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)

7020 Posts

Posted - 2008-01-29 : 23:34:56
[code]
SELECT a.id, a.name
FROM
table_1 a
WHERE
a.name COLLATE ...case sensitive collation name... LIKE
'DAR%' COLLATE ...case sensitive collation name...
[/code]

CODO ERGO SUM
Go to Top of Page
   

- Advertisement -