Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL - like/upper
Message
From
27/05/2007 12:27:58
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
 
To
27/05/2007 11:07:52
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01228764
Message ID:
01228768
Views:
23
>Hi
>How can I get all the lines that include the capital letter 'F' in anywhere in certain field.
>If I use with 'like' I get also 'f' and I want to get only capital.

Look up "Collation Precedence" in the Transact-SQL help. You need to add a COLLATE keyword followed by a collate selection (a case blind one) pretty much like this:
select .... where myfield COLLATE Latin1_General_CS_AI like '%F%'
The CS in the sequence name is CaseSensitive, and for each such one there's a CI one (insensitive). The AS/AI is for accent sensitivity.

There are other options - you can set a column case sensitive or not, the whole table, whole database, or the whole server (also accent sensitive or not etc), but then your field names and table names may become case sensitive and a lot of code may break. I think this is the simplest.

To get a list of all the collations your server has,

SELECT *
FROM ::fn_helpcollations()

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Reply
Map
View

Click here to load this message in the networking platform