Avatar of Ricky White
Ricky White
Flag for United States of America asked on

Assistance with Sql server query uppercase?

Environment: Sql Server 2000

State:
California
WASHINGTON
UTAH

I have a SQL table and would like to search for all state's that are fully in uppercase.

My Sql query is

Select * from temp
where state = uppercase states

expected results:
WASHINGTON
UTAH

Please advise. how can this be achieved?

Thanks!
Microsoft SQL ServerMicrosoft SQL Server 2005SQL

Avatar of undefined
Last Comment
Ricky White

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Ron Malmstead

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
SOLUTION
Brendt Hess

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
keyu

declare @statelist as varchar(max)

select @statelist=coalesce(@statelist,',')+state from table_name where state=upper(state)

select @statelist
Ricky White

ASKER
Thanks!
I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck