SQL Syntax Recommendations
The Microsoft® SQL Server™ version 7.0 Transact-SQL version complies with the Entry level of the SQL-92 standard, and supports many additional features from the Intermediate and Full levels of the standard.
The OLE DB and ODBC APIs were developed with the understanding that applications would use:
- SQL-92 syntax whenever it provides the functionality needed by the application. Because the SQL dialects of most databases now comply with the Entry level of SQL-92 and support many features in the Intermediate and Full levels, this means many OLE DB providers and ODBC drivers can simply pass through most SQL-92 syntax without having to transform it to something accepted by the database.
- Use the ODBC extensions to SQL-92 whenever they provide functionality needed by the application that SQL-92 does not support.
- Use the native SQL syntax of the database engine whenever it provides functionality needed by the application that SQL-92 and the ODBC extensions do not support.
This approach minimizes the overhead of OLE DB providers and ODBC drivers. The providers and drivers only have to parse incoming SQL statements for ODBC escape sequences or SQL-92 syntax not accepted by the database. Any ODBC escape sequences and unsupported SQL-92 syntax are transformed into the corresponding SQL syntax accepted by the database engine. All other SQL syntax is passed through to the database engine.
SQL Server 7.0 applications using OLE DB, ODBC, or one of the other APIs that encapsulate these two, should follow these guidelines and:
- Use SQL-92 syntax whenever it provides the functionality needed by the application.
- Use ODBC escape sequences when they provide functionality needed by the application but not provided by SQL-92.
- Use Transact-SQL syntax when it provides functionality needed by the application but not provided by SQL-92 or the ODBC escape sequences.
Using SQL with DB-Library and Embedded SQL
DB-Library supports only Transact-SQL. DB-Library does not support the ODBC escape sequences.
ESQL/C supports only the SQL syntax defined in Embedded SQL for C and SQL Server.
(c) 1988-98 Microsoft Corporation. All Rights Reserved.