Author |
Topic |
nextaxtion
Yak Posting Veteran
54 Posts |
Posted - 2011-01-06 : 00:56:23
|
hi, what is global cursor and local cursor ,how can we change global cursors to local cursorsprithvi nath pandey |
|
Lumbago
Norsk Yak Master
3271 Posts |
Posted - 2011-01-06 : 03:15:08
|
FROM BOL (http://msdn.microsoft.com/en-us/library/ms180169.aspx):quote: GLOBALSpecifies that the scope of the cursor is global to the connection. The cursor name can be referenced in any stored procedure or batch executed by the connection. The cursor is only implicitly deallocated at disconnect.NoteIf neither GLOBAL or LOCAL is specified, the default is controlled by the setting of the default to local cursor database option. In SQL Server version 7.0, this option defaults to FALSE to match earlier versions of SQL Server, in which all cursors were global. The default of this option may change in future versions of SQL Server. For more information, see Setting Database Options.
DECLARE GLOBAL CURSOR cur AS ...On a side note: cursors are the devil!!- LumbagoMy blog (yes, I have a blog now! just not that much content yet) -> www.thefirstsql.com |
 |
|
nextaxtion
Yak Posting Veteran
54 Posts |
Posted - 2011-01-06 : 03:37:56
|
i hava a global cursor but i don't want to change the code but want to behave like local then...prithvi nath pandey |
 |
|
Lumbago
Norsk Yak Master
3271 Posts |
Posted - 2011-01-06 : 03:50:21
|
"I have a doughnut but I would reeeally like it to be a cupcake without touching it. How can I do that?"- LumbagoMy blog (yes, I have a blog now! just not that much content yet) -> www.thefirstsql.com |
 |
|
nextaxtion
Yak Posting Veteran
54 Posts |
Posted - 2011-01-06 : 05:48:04
|
ok...prithvi nath pandey |
 |
|
michael.appleton
Posting Yak Master
160 Posts |
Posted - 2011-01-06 : 06:00:52
|
What you're saying nextaxtion, makes absolutely no sense. What kind of method did you have in mind to change the behaviour besides changing the code? |
 |
|
nextaxtion
Yak Posting Veteran
54 Posts |
Posted - 2011-01-06 : 07:22:12
|
quote: Originally posted by michael.appleton What you're saying nextaxtion, makes absolutely no sense.
OH,REALLY....prithvi nath pandey |
 |
|
nextaxtion
Yak Posting Veteran
54 Posts |
Posted - 2011-01-06 : 07:27:59
|
how to get all cursors name that are in database in open or closed state.prithvi nath pandey |
 |
|
robvolk
Most Valuable Yak
15732 Posts |
Posted - 2011-01-06 : 10:08:19
|
http://msdn.microsoft.com/en-us/library/ms186256.aspxIt's probably better you spend a few minutes poking around Books Online under "cursors" than posting a lot of onesie-twosie questions about them. It'll save time. |
 |
|
|