Results 1 to 5 of 5
  1. #1
    Join Date
    Aug 2002
    Posts
    8

    Unanswered: URGENT - SQL Server replication failing

    SQL server replication is failing with the following error

    "A cursor with the name 'CompanyCursor' already exists"

    How do I deallocate this cursor so that replication stays up?
    Any suggestions will be much appreaciated.

    Pillai

  2. #2
    Join Date
    Dec 2002
    Location
    NJ, USA
    Posts
    9

    Question URGENT - SQL Server replication failing

    I assume yoy=u are running the stored procedure replication option ? You must be leaving one of your cursors without deallocating it in one of your stored procedures.

    When the stored procedure is called more than once on the publisher side, it tries to repeat the same in a single session on the subscriber end, it finds the cursor already there. ??

  3. #3
    Join Date
    Feb 2002
    Posts
    2,232
    Which version of sql server are you running (including service pack) ? Which replication are you using ? Look at your sql server logs to see if additional information exists. Are you creating the cursor ?

  4. #4
    Join Date
    Aug 2002
    Posts
    8

    Re: URGENT - SQL Server replication failing

    Originally posted by ngurukiran
    I assume yoy=u are running the stored procedure replication option ? You must be leaving one of your cursors without deallocating it in one of your stored procedures.

    When the stored procedure is called more than once on the publisher side, it tries to repeat the same in a single session on the subscriber end, it finds the cursor already there. ??
    ----

    Yes the above seems to be the case. How do I deallocate the cursor? Is there a global setting that I can check to find outstanding cursors? Or do I need to remove subscription and recreate it?

  5. #5
    Join Date
    Dec 2002
    Location
    NJ, USA
    Posts
    9

    cursor problem ..

    You will have to cleanup the code on your end. Good programming practice dictates that any cursor created and opened should always be closed and deallocated.

    I guess you could try doing a search on the user stored procedures for the name of the cursor and edit the code to add the code deallocating it at the end of the stored procedure. After that, you may want to try removing replication and setting it up again, starting with a snapshot.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •