Transact-SQL Subset Used for Generating Remote Queries
SQL Server uses the following subset of the Transact-SQL language for queries evaluated by SQL command providers:
- SELECT statements with SELECT, FROM, WHERE, GROUP BY, UNION, UNION ALL, ORDER BY DESC, ASC, and HAVING clauses. UNION and UNION ALL are generated only against providers that support SQL-92 entry level, not against those supporting ODBC Core.
- SELECT clause:
- Scalar subqueries in the SELECT list.
- Column aliases without the AS keyword.
- FROM clause:
- Explicit join keywords are not used; comma-separated table names are used to specify inner joins, and outer joins are not specified in remote queries.
- Nested queries of the form FROM ( <nested query> ) <alias>.
- Table aliases without the AS keyword.
- WHERE clause uses subqueries with [NOT] EXISTS, ANY, ALL.
- Expressions:
- Aggregate functions used: MIN([DISTINCT]), MAX([DISTINCT]), COUNT([DISTINCT]), SUM([DISTINCT]), AVG([DISTINCT]), and COUNT(*).
- Comparison Operators: <, =, <=, >, <>, >=, IS NULL, and IS NOT NULL.
- Boolean operators: AND, OR, and NOT.
- Arithmetic operators: +, -, *, and /.
- Constants:
- Numeric and money literals are always surrounded by ( ).
- Character literals are quoted with ‘‘.