Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
$ equivalent in SQL Server?
Message
From
25/01/2002 06:26:13
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
General information
Forum:
Visual FoxPro
Category:
Client/server
Miscellaneous
Thread ID:
00610309
Message ID:
00610354
Views:
21
>Is there an equivalent of Fox's $ operator in SQL's query syntax? For example, in Fox I can ...
>
>SELECT * FROM customer WHERE "AL" $ customer.lastname
>
>... how I do the same in SQL Server?
>
>Thanks.
Mark universally available syntax is :
customer.lastname like '%AL%'
Also there are some function in SQL server like chrindex(),patindex(). Especially patindex() is worth to check, it supports a rich set of pattern definition (ie: patindex('%AL%',customer.lastname)>0 is same as like '%AL%'. But say you want to also find AL not followed by chars s,p,m and don't want to bother if SQL is case sensitive or not :
patindex('%[Aa][Ll][^SsPpMm]%',customer.lastname)>0
).
PS: Patindex patterns are also supported with like.
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Reply
Map
View

Click here to load this message in the networking platform