---
title: "What is cursor in SQL Server?"  
description: "What is cursor in SQL Server?"  
author: "Anonymous User"  
published: 2015-05-30  
updated: 2020-09-18  
canonical: https://www.mindstick.com/interview/2594/what-is-cursor-in-sql-server  
category: "mssql server"  
tags: ["sql server", "sql"]  
reading_time: 2 minutes  

---

# What is cursor in SQL Server?

1. A Cursor is a database object that represents a result set and is used to manipulate data row by row.

2. When a cursor is opened, it is positioned on a row and that row is available for processing.

3. SQL Server supports three types of cursor namely Transact-SQL server cursor, API server cursor, and client cursor.

4. Transact-SQL Server cursors use Transact-SQL statements and are declared using DECLARE CURSOR statement.

5. Transact-SQL Server cursors can be used in Transact-SQL scripts, stored procedures, and triggers.

6. Transact-SQL cursors are implemented on the server.

7. You can fetch only one row at a time in Transact-SQL Server cursors.

8. You can use FETCH statements with Transact-SQL cursors to retrieve rows from a cursor’s result set.

9. API server cursors support the API cursor functions.

10. API server cursors are implemented on the server.

11. API server cursors support fetching blocks of rows with each fetch.

12. A cursor fetches multiple rows at a time is called a block cursor

## Answers

### Answer by Anonymous User

1. A Cursor is a database object that represents a result set and is used to manipulate data row by row.

2. When a cursor is opened, it is positioned on a row and that row is available for processing.

3. SQL Server supports three types of cursor namely Transact-SQL server cursor, API server cursor, and client cursor.

4. Transact-SQL Server cursors use Transact-SQL statements and are declared using DECLARE CURSOR statement.

5. Transact-SQL Server cursors can be used in Transact-SQL scripts, stored procedures, and triggers.

6. Transact-SQL cursors are implemented on the server.

7. You can fetch only one row at a time in Transact-SQL Server cursors.

8. You can use FETCH statements with Transact-SQL cursors to retrieve rows from a cursor’s result set.

9. API server cursors support the API cursor functions.

10. API server cursors are implemented on the server.

11. API server cursors support fetching blocks of rows with each fetch.

12. A cursor fetches multiple rows at a time is called a block cursor


---

Original Source: https://www.mindstick.com/interview/2594/what-is-cursor-in-sql-server

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
