You are here: Re: error: Cursor not returned from query « MsSQL Server « IT news, forums, messages
Re: error: Cursor not returned from query

Posted by Erland Sommarskog on 05/26/06 17:17

IW2FIV (carlo.merlini[NONROMPERE]@libero.it) writes:
> I'm a really beginner about sql2000.
> During my test I have created the following query. It's works ok until I
> do't add the code included in section A, when I add it the i obtain the
> error: Cursor not returned from query

Apparently you are using some environment unknown to me. At least I
don't recognize the message.

> IF OBJECT_ID('storico_big') IS NULL --- section A begin
> create table storico_big( data datetime,
> bcarrier varchar(20),
> bda CHAR(30),
> bzone char(50),
> bdur int) ;
> insert into storico_big --- section A
> end

Since there are several apparent syntax errors here, it would have been nice
if you environment had returned the errors from SQL Server, rather than
bitching about the missing cursor.

It can be a good to run the query from Query Analyzer to get better
error diagnostics.

I don't really want to suggest a correction, because I can't understand
what you are trying to do. It appears that in the same batch that you first
want to create a table, insert into it, and then select data from another
table.

Possibly you want to insert the data from the SELECT statement into
storico_big, but in such case you should

1) get rid of that extraneous end
2) add an explicit column list to the INSERT statement.

However, I have a feeling that if you insert data into the table, the
client environment will still complain about a missing cursor...


--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация