Skip to content

Latest commit

 

History

History
38 lines (29 loc) · 2.06 KB

File metadata and controls

38 lines (29 loc) · 2.06 KB
title Using Server Cursors | Microsoft Docs
ms.custom
ms.date 03/14/2017
ms.prod sql
ms.prod_service database-engine, sql-database, sql-data-warehouse, pdw
ms.reviewer
ms.technology native-client
ms.topic reference
helpviewer_keywords
ODBC applications, cursors
cursors [ODBC], server cursors
ODBC cursors, server cursors
server cursors [SQL Server]
ms.assetid 8a6d99b7-10b8-4474-8639-4914b25ba170
author markingmyname
ms.author maghan
monikerRange >=aps-pdw-2016||=azuresqldb-current||=azure-sqldw-latest||>=sql-server-2016||=sqlallproducts-allversions||>=sql-server-linux-2017||=azuresqldb-mi-current

Using Server Cursors

[!INCLUDEappliesto-ss-asdb-asdw-pdw-md]

If an ODBC application sets any of the ODBC cursor attributes to anything other than the defaults, the [!INCLUDEssNoVersion] Native Client ODBC driver requests the server to implement an API server cursor of the same type. Using API server cursors frees memory on the client and can significantly reduce network traffic between the client and server.

A potential drawback of API server cursors is that they currently do not support all SQL statements. API server cursors cannot be used to execute:

  • Batches or stored procedures that return multiple result sets.

  • SELECT statements that contain COMPUTE, COMPUTE BY, FOR BROWSE, or INTO clauses.

  • An EXECUTE statement referencing a remote stored procedure.

When connected to an instance of [!INCLUDEssNoVersion], executing a statement with these characteristics using a server cursor causes the cursor being converted to a default result set. When connected to earlier versions of [!INCLUDEssNoVersion], it causes an error.

See Also

How Cursors Are Implemented