Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics GP (Archived)

A Cursor with the name 'MyInsertCursor' already exists.

Posted on by 1,195

Hi,

I am getting following error at one of my client server while executing a stored procedure from GP. This sql procedure is being called from Dex.

SQL Error: 16915 - A Cursor with the name 'MyInsertCursor' already exists.

Same chunk file and sql proc is working fine in my Test server.

More details: I am doing "insert into table" inside the procedure. I am getting above error after this Insert. Through Profiler I got to know this.

Quick response is highly appreciated.

*This post is locked for comments

  • Verified answer
    Manjunath Vemula Profile Picture
    Manjunath Vemula 1,195 on at
    RE: A Cursor with the name 'MyInsertCursor' already exists.

    Sorry for delayed response.

    By using profiler found it was not getting refreshed. Creating again solved the issue.

  • Mahmoud Saadi Profile Picture
    Mahmoud Saadi 32,738 on at
    RE: A Cursor with the name 'MyInsertCursor' already exists.

    You will have to track this down on the SQL profiler level.

    Your feedback is highly appreciated,

  • Manjunath Vemula Profile Picture
    Manjunath Vemula 1,195 on at
    RE: A Cursor with the name 'MyInsertCursor' already exists.

    Thanks for your response Mahmoud.

    I made this change and it is working fine. But same trigger working correctly at one server but not in other.

    Suggestion on this would be highly appreciated.

  • Verified answer
    Mahmoud Saadi Profile Picture
    Mahmoud Saadi 32,738 on at
    RE: A Cursor with the name 'MyInsertCursor' already exists.

    It is quite possible that this is a "global" cursor; which means that each time you call this procedure, the cursor will be defined.

    Try to use a "Local" cursor instead

    DECLARE  MyInsertCursor CURSOR LOCAL

    Your feedback is highly appreciated,

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans