DF010: The scope of a cursor (LOCAL or GLOBAL) is not specified.
Last modified: May 28, 2025
The topic describes the DF010 T-SQL code analysis rule.
Category
BEST PRACTICE
Message
The scope of a cursor (LOCAL or GLOBAL) is not specified.
Description
It is recommended to explicitly define the scope of a cursor: LOCAL or GLOBAL.
Additional information
If neither GLOBAL nor LOCAL is specified, the default value is determined by the default to local cursor database parameter setting.
Noncompliant code example
DECLARE cur CURSOR READ_ONLY FOR
SELECT FirstName FROM dbo.Customers
Compliant solution
DECLARE cur CURSOR LOCAL READ_ONLY FOR
SELECT FirstName FROM dbo.Customers
Was this page helpful?
Want to find out more?
Overview
Take a quick tour to learn all about the key benefits delivered by dbForge Studio for SQL Server.
All features
Get acquainted with the rich features and capabilities of the tool in less than 5 minutes.
Request a demo
If you consider employing this tool for your business, request a demo to see it in action.