Skip to content

Latest commit

 

History

History
30 lines (24 loc) · 2.42 KB

File metadata and controls

30 lines (24 loc) · 2.42 KB
title description author ms.author ms.date ms.service ms.subservice ms.topic helpviewer_keywords
Procedures
Procedures
markingmyname
maghan
03/14/2017
sql
native-client
reference
stored procedures [ODBC]
stored procedures [ODBC], about ODBC stored procedures
ODBC applications, statements
statements [ODBC], stored procedures
ODBC applications, stored procedures

Procedures

[!INCLUDE SQL Server]

A stored procedure is a precompiled executable object that contains one or more [!INCLUDEtsql] statements. Stored procedures can have input and output parameters and can also put out an integer return code. An application can enumerate available stored procedures by using catalog functions.

ODBC applications that target [!INCLUDEssNoVersion] should only use direct execution to call a stored procedure. When connected to earlier versions of [!INCLUDEssNoVersion], the [!INCLUDEssNoVersion] Native Client ODBC driver implements SQLPrepare Function by creating a temporary stored procedure, which is then called on SQLExecute. It adds overhead to have SQLPrepare create a temporary stored procedure that only calls the target stored procedure versus directly executing the target stored procedure. Even when connected to an instance of [!INCLUDEssNoVersion], preparing a call requires an extra round trip across the network and the building of an execution plan that just calls the stored procedure execution plan.

ODBC applications should use the ODBC CALL syntax when executing a stored procedure. The driver is optimized to use a remote procedure call mechanism to call the procedure when the ODBC CALL syntax is used. This is more efficient than the mechanism used to send a [!INCLUDEtsql] EXECUTE statement to the server.

For more information, see Running Stored Procedures.

See Also

Executing Statements (ODBC)