MS SQL Server 2008 R2 - like 'S%' returns no rows but like 'Se%' does

I have a MS SQL 2008 R2 production database that does not like 'S%'

the statements:
select * from TLMS.ELEMENT where ELEMENT_ID like 'S%' ;
select * from TLMS.ELEMENT where ELEMENT_ID like 'S_' ;
select * from TLMS.ELEMENT where ELEMENT_ID like '[S]%' ;

all return zero rows.

Whereas the statement (for example)

select * from TLMS.ELEMENT where ELEMENT_ID like 'Se%' ;

returns two rows.

All other 'non-S-as-first-character' matches are OK and other databases on the same engine are OK with 'S%'.

Any ideas?
stephen_ausAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

chaauCommented:
Is ELEMENT_ID varchar, nvarchar, or something else?
0
stephen_ausAuthor Commented:
Thanks for your reply
varchar(12) - I have also just noticed that the Collation type that we have used on this database can cause unexpected results with pattern matching with wildcards.

The collation we are using is:
Latin1_General_100_CS_AI_KS

I think the solution is the latest service pack for MS SQL Server 2008 R2 or to change the collation type to something like: SQL_Latin1_General_CP1_CI_AS
0
chaauCommented:
Collation might be a problem.
You know, you can change the collation for one of the tables to test, before applying it to the whole database
0
stephen_ausAuthor Commented:
The problem is that this is a production database with many PK, FK constraints - the change will be difficult. I will probably go with the latest service pack for SQL Server - thanks for you replies.
0
Tony303Commented:
You could change the collation in the query to see if it brings the s's into the result.

select * from TLMS.ELEMENT where ELEMENT_ID COLLATE SQL_Latin1_General_CP1_CI_AS like 'S%' ;
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft SQL Server 2008

From novice to tech pro — start learning today.