Skip to content

Latest commit

 

History

History
51 lines (38 loc) · 2.59 KB

File metadata and controls

51 lines (38 loc) · 2.59 KB
title description author ms.author ms.date ms.service ms.subservice ms.topic helpviewer_keywords
Command syntax (Native Client OLE DB provider)
Command syntax (Native Client OLE DB provider)
markingmyname
maghan
03/14/2017
sql
native-client
reference
SQL Server Native Client OLE DB provider, commands
commands [OLE DB]
SQL Server Native Client OLE DB provider, stored procedures
stored procedures [OLE DB], command syntax

SQL Server Native Client Command Syntax

[!INCLUDESQL Server Azure SQL Database Synapse Analytics PDW]

The [!INCLUDEssNoVersion] Native Client OLE DB provider recognizes command syntax specified by the DBGUID_SQL macro. For the [!INCLUDEssNoVersion] Native Client OLE DB provider, the specifier indicates that an amalgam of ODBC SQL, ISO, and [!INCLUDEtsql] is valid syntax. For example, the following SQL statement uses an ODBC SQL escape sequence to specify the LCASE string function:

SELECT customerid={fn LCASE(CustomerID)} FROM Customers  

LCASE returns a character string, converting all uppercase characters to their lowercase equivalents. The ISO string function LOWER performs the same operation, so the following SQL statement is a ISO equivalent to the ODBC statement presented above:

SELECT customerid=LOWER(CustomerID) FROM Customers  

The [!INCLUDEssNoVersion] Native Client OLE DB provider processes either form of the statement successfully when specified as text for a command.

Stored Procedures

When executing a [!INCLUDEssNoVersion] stored procedure using a [!INCLUDEssNoVersion] Native Client OLE DB provider command, use the ODBC CALL escape sequence in the command text. The [!INCLUDEssNoVersion] Native Client OLE DB provider then uses the remote procedure call mechanism of [!INCLUDEssNoVersion] to optimize command processing. For example, the following ODBC SQL statement is preferred command text over the [!INCLUDEtsql] form:

  • ODBC SQL

    {call SalesByCategory('Produce', '1995')}  
    
  • Transact-SQL

    EXECUTE SalesByCategory 'Produce', '1995'  
    

See Also

Commands