I currently use SQL via ADO 2.8 (with Delphi) with Access databases, and sometimes with SQL Server 2005.
But the syntaxes are not the same for the 2 databases.
Is there, somewhere, a list of the differences in order to adapt the queries for the 2 databases ?
Convert Microsoft Access (JET SQL) to SQL Server (T-SQL) but it seems not to be up to date.
Remark: I don't use existing databases; I create them with ADO.
Informations with some 'edits' help :
1/ My goal is to have only one Query for Access & MS SQL and to translate the query depending on the choosen database.
For it I need to know what is the best syntax for my query and how (and if I have to) to translate when I change my database.
Example : for the datetime :
Access : SELECT * FROM MYTABLE WHERE SomeDate = #1/1/2005#
T-SQL: SELECT * FROM MYTABLE WHERE SomeDate = '1/1/2005'
But I found some informations where you may use for both : SELECT * FROM MYTABLE WHERE SomeDate = #2011-02-22 00.00.00#
If your interest is DDL queries for Access (Jet/ACE) and SQL Server, see this table of data types on MSDN: Equivalent ANSI SQL Data Types
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With