Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
gamaz2
Starting Member
31 Posts |
Posted - 2008-07-08 : 16:50:43
|
Hi,I am running this simple cursor (testing). However the last row is a blank that is being returned. I am not sure why. Also when I am running this code again in the EM I am not getting any result set. It only states that command successfully executed. Any help is apreciated. ThanksCODE:declare authors_cursor cursor for select * from authorsopen authors_cursor While (@@fetch_status = 0) fetch next from authors_cursorclose authors_cursordeallocate authors_cursor |
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2008-07-08 : 18:45:51
|
What are you trying to do with your query here ? Your query is doing nothing except open the cursor, loop through all records and close the cursor. KH[spoiler]Time is always against us[/spoiler] |
 |
|
gamaz2
Starting Member
31 Posts |
Posted - 2008-07-08 : 19:17:47
|
I need to display all the records from the authors table using this simple cursor. Thanks. |
 |
|
khtan
In (Som, Ni, Yak)
17689 Posts |
|
gamaz2
Starting Member
31 Posts |
Posted - 2008-07-08 : 19:52:58
|
Thanks for the links. I am pretty new to cursor. Regards. |
 |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-07-09 : 00:53:51
|
Were you just learning cursors?There's absolutely no need for cursor to just select records from a table. |
 |
|
gamaz2
Starting Member
31 Posts |
Posted - 2008-07-09 : 17:59:57
|
That is correct. I am in the process of learning cursor. Thanks. |
 |
|
|
|
|