Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
d
Starting Member
26 Posts |
Posted - 2001-12-19 : 09:30:23
|
| I have a stored procedure move_data where I have declared 3 cursors:declare A_cursor cursor for......declare B_cursor cursor for......declare C_cursor cursor for......In begin..end , based on some conditions I either open A_cursor or B_cursor, C_cursor.However, when I execute my procedure, it says the following:Server: Msg 16915, Level 16, State 1, Line 0A cursor with the name 'A_cursor' already exists.Server: Msg 16915, Level 16, State 1, Procedure move_data, Line 51A cursor with the name 'B_cursor' already exists.Server: Msg 16915, Level 16, State 1, Procedure move_data, Line 93It does not mention an error for C_cursor since based on the conditions in begin..end, C_cursor got opened.Why am I getting the error???Any help will be greatly appreciated.Thanks. |
|
|
robvolk
Most Valuable Yak
15732 Posts |
Posted - 2001-12-19 : 10:48:09
|
| Can you post your entire code? Don't worry about how big it is. Multiple cursors are not only tricky but serious performance killers, we might be able to rewrite it as a set based process. |
 |
|
|
|
|
|
|
|