473,378 Members | 1,620 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

A cursor with the name 'deadrow' already exists.

I'm trying to track this error from the driver down:
'42000' [-1] '[Microsoft][ODBC SQL Server Driver][SQL Server]A cursor
with the name 'deadrow' already exists. ** AND ** [Microsoft][ODBC SQL
Server Driver][SQL Server]The statement has been terminated.'
[msg='SQL call failed.'].
Jul 20 '05 #1
5 21647

"Todd" <ta******@hotmail.com> wrote in message
news:ed**************************@posting.google.c om...
I'm trying to track this error from the driver down:
'42000' [-1] '[Microsoft][ODBC SQL Server Driver][SQL Server]A cursor
with the name 'deadrow' already exists. ** AND ** [Microsoft][ODBC SQL
Server Driver][SQL Server]The statement has been terminated.'
[msg='SQL call failed.'].


It's not possible to say exactly what happened without more information, but
it seems that your client application has declared a cursor called deadrow
but not closed and deallocated it afterwards. If the same code is then run
again, you will get this error.

Simon
Jul 20 '05 #2
To add to Simon's response, it's a good practice to explicitly declare
cursors as LOCAL unless you have a reason to do otherwise. This will ensure
the cursor is deallocated when it goes out of scope.

--
Hope this helps.

Dan Guzman
SQL Server MVP
"Todd" <ta******@hotmail.com> wrote in message
news:ed**************************@posting.google.c om...
I'm trying to track this error from the driver down:
'42000' [-1] '[Microsoft][ODBC SQL Server Driver][SQL Server]A cursor
with the name 'deadrow' already exists. ** AND ** [Microsoft][ODBC SQL
Server Driver][SQL Server]The statement has been terminated.'
[msg='SQL call failed.'].

Jul 20 '05 #3
Dan Guzman (da*******@nospam-earthlink.net) writes:
To add to Simon's response, it's a good practice to explicitly declare
cursors as LOCAL unless you have a reason to do otherwise. This will
ensure the cursor is deallocated when it goes out of scope.


Yeah, but then you cannot declare them as INSENSITIVE, which also is a
good practice, as that saves you from the surprises that keyset-driven
cursors can give you.

Maybe STATIC or FAST_FORWARD are the same as INSENSITIVE, but I have
never managed to grasp the cursor excesses that were added to SQL7.

Besides, INSENSITIVE is ANSI compliant, while LOCAL is not.

There is a database option to make local cursors the default, though.

--
Erland Sommarskog, SQL Server MVP, so****@algonet.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp
Jul 20 '05 #4


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 20 '05 #5
Actually we don't have a cursor named 'deadrow' it seems so we figure it
coming from the odbc driver for sql server.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 20 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Hareesh | last post by:
Hi, I am trying a Set Approach instead of Using of Cursor (which works). I am attaching the SQL to create tables and the my Procedure, and a piece of code to execute the Procedure. I would...
7
by: William Gill | last post by:
I have been trying to pass parameters as indicated in the api. when I use: sql= 'select * from %s where cusid = %s ' % name,recID) Cursor.execute(sql) it works fine, but when I try : sql=...
13
by: WALDO | last post by:
I have a .Net TextBox (TextBoxBase, really) in which I am appending about 20 lines of text per second. I use the AppendText() method to accomplish this. This is a great substitute for taking the...
2
by: Bill_DBA | last post by:
I have the following stored procedure that is called from the source of a transformation in a DTS package. The first parameter turns on PRINT debug messages. The second, when equals 1, turns on the...
2
by: Andrus | last post by:
I'm trying to compile myGeneration PropertyCollectionAll.cs file with VCS Express 2005 bot got error Error 1 The type or namespace name 'Collection' could not be found (are you missing a using...
1
by: shorti | last post by:
Hello all, I asked this question a slightly different way earlier and didnt get a response so I thought I would rephrase it. I contacted db2 support on it also but never got a definite...
1
by: yeohyc | last post by:
Hi All, I have a problem here. I have done a request for move order it was stored into a custom table with the format: (O)336126(G)83(I)21823(M)630065120(L)LOT-DISB2P-01(Q)2500...
36
by: CK | last post by:
How do I write a set based query? I have a groupSets table with fields setId, idField, datasource, nameField, prefix, active Data: 1,someIDfield, someTable, someField, pre1, 1 2,someotherIDfield,...
0
by: newbieee | last post by:
Hi, I've proto-typed a solution to match customer records from varying sources. There may be up to 1million records in the customers table so I need to progress this into a set-based solution for...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.