65.9K
CodeProject is changing. Read more.
Home

Always close your cursor

starIconstarIconstarIconstarIconstarIcon

5.00/5 (3 votes)

Oct 18, 2011

CPOL
viewsIcon

10890

To see the default value of the cursor scope:select * from sys.databases(if value of "is_local_cursor_default" is 0 then scope id global, otherwise it is local).The scope is GLOBAL by default (for compatibility reasons).To change default scope use following:ALTER DATABASE...

To see the default value of the cursor scope:
select * from sys.databases
(if value of "is_local_cursor_default" is 0 then scope id global, otherwise it is local). The scope is GLOBAL by default (for compatibility reasons). To change default scope use following:
ALTER DATABASE [YourDatabase] SET CURSOR_DEFAULT LOCAL;