Unix Technical Forum

A cursor with the name 'deadrow' already exists.

This is a discussion on A cursor with the name 'deadrow' already exists. within the SQL Server forums, part of the Microsoft SQL Server category; --> I'm trying to track this error from the driver down: '42000' [-1] '[Microsoft][ODBC SQL Server Driver][SQL Server]A cursor with ...


Go Back   Unix Technical Forum > Database Server Software > Microsoft SQL Server > SQL Server

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-28-2008, 08:28 PM
Todd
 
Posts: n/a
Default 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.'].
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-28-2008, 08:29 PM
Simon Hayes
 
Posts: n/a
Default Re: A cursor with the name 'deadrow' already exists.


"Todd" <talltodd@hotmail.com> wrote in message
news:eda42e3f.0401090715.5e75fd6f@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


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 02-28-2008, 08:29 PM
Dan Guzman
 
Posts: n/a
Default Re: A cursor with the name 'deadrow' already exists.

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" <talltodd@hotmail.com> wrote in message
news:eda42e3f.0401090715.5e75fd6f@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.'].



Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 02-28-2008, 08:30 PM
Erland Sommarskog
 
Posts: n/a
Default Re: A cursor with the name 'deadrow' already exists.

Dan Guzman (danguzman@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, sommar@algonet.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 02-28-2008, 08:30 PM
Todd H
 
Posts: n/a
Default Re: A cursor with the name 'deadrow' already exists.





*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 02-28-2008, 08:30 PM
Todd H
 
Posts: n/a
Default Re: A cursor with the name 'deadrow' already exists.

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!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 10:19 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com