Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VFP select not same as SQL Select
Message
 
 
To
18/10/2005 23:03:18
Joel Hokanson
Services Integration Group
Bellaire, Texas, United States
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows 2000 SP4
Network:
Windows 2000 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01060137
Message ID:
01060140
Views:
13
This message has been marked as the solution to the initial question of the thread.
>select * from cities where city='HOUSTON' in VFP produces 4 records
>
>city Houston, HOUSTON, HOUSTON HEIGHTS , HOUSTON AIRPORT. Which is right


It's neither right nor wrong but thats the way string are compared in a query when SET ANSI is OFF (default). You can find more details in the help for SET ANSI command

>select * from cities where city='HOUSTON' in MS SQL 2000 produces 2 records
>
>city Houston, HOUSTON
>
>Naturally I can set exact on in VFP,
>but I would prefer to know how to say "city Starts with HOUSTON" in SQL


The SET EXACT has no effect on SQL commands. You can use LIKE operator in SQL Server and VFP
select * 
  from cities 
where city LIKE 'HOUSTON%'
--sb--
Previous
Reply
Map
View

Click here to load this message in the networking platform