stanl
01-26-2008, 07:04 AM
As this forum has set idle a bit, I would like to suggest a continuing discussion of SQL syntax variations between db's, providers etc...
For example, a common gotcha is the use of * as substitution in Access queries, which must be converted to % when issuing those queries via ADO.
Having recently worked with Access and SQL Server 2005 I have found
Access: 'Select ... WHERE [var]="value"'
SQLServer: "Select ... WHERE [var]='value'"'
Access: Select ... WHERE len(trim([var]))=value
SQLServer: Select ... WHERE len([var])=value
Access: Select .... WHERE ucase([var])=VALUE
SQLServer: Select ... WHERE [var]=VALUE 'or value or Value
trivial examples, but nice to know when upsizing code.
Stan
For example, a common gotcha is the use of * as substitution in Access queries, which must be converted to % when issuing those queries via ADO.
Having recently worked with Access and SQL Server 2005 I have found
Access: 'Select ... WHERE [var]="value"'
SQLServer: "Select ... WHERE [var]='value'"'
Access: Select ... WHERE len(trim([var]))=value
SQLServer: Select ... WHERE len([var])=value
Access: Select .... WHERE ucase([var])=VALUE
SQLServer: Select ... WHERE [var]=VALUE 'or value or Value
trivial examples, but nice to know when upsizing code.
Stan