| RE: [SQLDownUnder] SOLVED SProc Recursion and A cursor with the name 'eventCursor' already exists error. |
- From: Greg Low
- Subject: RE: [SQLDownUnder] SOLVED SProc Recursion and A cursor with the name 'eventCursor' already exists error.
- Date: Sat, 05 Mar 2005 00:05:10 +1100
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
And keep in mind that CTE's (Common Table Expressions) in SQL Server 2005 make many styles of recursive queries very easy (by comparison), particulary walking org charts, bill of materials, etc. Regards, Greg -----Original Message----- From: SQLDownUnderList@xxxxxxxxxxxxxxxxxxxxxx [mailto:SQLDownUnderList@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of David Ames Sent: Friday, 4 March 2005 8:00 PM To: SQLDownUnder@xxxxxxxxxxxxxxxxxxxxxx; SQLDownUnder@xxxxxxxxxxxxxxxxxxxxxx Subject: RE: [SQLDownUnder] SOLVED SProc Recursion and A cursor with the name 'eventCursor' already exists error. Hi All, Thanks for the replies - they really got me thinking... Anyway, in the end the answer was very simple (as they almost always are). Simply declare the cursor as LOCAL, eg: DECLARE cur_Level CURSOR LOCAL... If anyone is after more info on recursion in SQL, this is a very handy artical: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnsqlmag01/ html/recursion.asp Regards, Dave -----Original Message----- From: Michael van der Veeke [mailto:michaelvanderveeke@xxxxxxxxxxxxxxxxxxxx] Sent: Fri 3/4/2005 12:54 PM To: SQLDownUnder@xxxxxxxxxxxxxxxxxxxxxx Cc: Subject: RE: [SQLDownUnder] SProc Recursion and A cursor with the name 'eventCursor' already exists error. Hello, Try adding this before the declare: IF Cursor_Status('variable', ' EventCursor ') <= 0 Setup EventCursor Otherwise just continue...should work Regards, Michael van der Veeke Database Administrator Border Express Pty Ltd Phone: (02) 6022 6046 Mobile : 0419 419 547 Email : michaelvanderveeke@xxxxxxxxxxxxxxxxxxxx Web : http://www.borderexpress.com NOTICE The information contained in this electronic mail message is privileged and confidential, and is intended only for use of the addressee. If you are not the intended recipient, any disclosure, reproduction, distribution or other use of this communication is strictly prohibited. If you have received this communication in error, please notify the sender by reply transmission and delete the message without copying or disclosing it. to unsubscribe to this list, please send a message back to the list with 'unsubscribe' as the subject. Powered by mailenable.com - List managed by http://www.readify.net
(Click here for more information on the sqldownunder mailling list)
- References:
- Prev by Date: RE: [SQLDownUnder] Country NSW/VIC
- Next by Date: [SQLDownUnder] When is SQL 2005 RTM'ing?
- Previous by thread: RE: [SQLDownUnder] SOLVED SProc Recursion and A cursor with the name 'eventCursor' already exists error.
- Next by thread: [SQLDownUnder] When is SQL 2005 RTM'ing?
- Index(es):
