Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Foxpro SQL vs. SQL Server syntax differences?
Message
 
 
To
02/08/2009 23:17:28
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9 SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01415825
Message ID:
01415879
Views:
75
>I'm preparing to do an app conversion where I will convert from DBF to SQL Server and begin using SqlExec(). I have lots of SQL strings in my app already that run fine against local DBF tables, so I'm wanting to see if there is a list somewhere or if you can give me advice on what syntax and stuff that works fine on DBF, but that will need to be modified to run on SQL server. This way I can scan my SQL strings and look for areas that I need to change.

- There's totally different set of built-in functions in VFP and SQL Server. See http://fox.wikis.com/wc.dll?Wiki~VFPSQL-TSQL-Mapping
- Look for WHERE conditions that combine multiple fields into one expression. SQL Server does not support such indexes and such query will not be optimizable.
- SQL Server does not support a filed alias in the ORDER BY or GROUP BY clauses
- SQL Server doesn't have a logical data type. The closest one is a BIT but it's numeric. a condition 'WHERE SomeField' has to be changed to 'WHERE SomeField=1'.
- The SQL server string comparison matches VFP with SET ANSI ON or when '==' operator is used. See http://www.berezniker.com/content/pages/visual-foxpro/string-comparison-vfp for details. Otherwise you may have to revise them.
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform