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 |
|
javaisok
Starting Member
11 Posts |
Posted - 2003-10-15 : 08:14:38
|
| does cursor populates empty rows into the response recordset when selectstatements has not found any records?declare cr_test cursor local read_onlyfor select id from dbo.test where bla...open cr_testfetch next from cr_test into @idwhile @@fetch_status = 0 begin fetch next from cr_test into @idendclose cr_testdeallocate cr_testthis statement is being executed inside of recursive procedure and every time when there are no records found i receive one more ghost row into the response. In some iteration there are some records found but they are placed at the end of response so it looks like this:ghost rowghost rowghost rowID---------------123...why this happends? The client software says they are no records inside! |
|
|
robvolk
Most Valuable Yak
15732 Posts |
Posted - 2003-10-15 : 08:22:57
|
| Please don't cross post:http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=29840 |
 |
|
|
javaisok
Starting Member
11 Posts |
Posted - 2003-10-17 : 03:22:59
|
| ... i just found the problem. It seems SQL server generates recordset foreach select statement from the body of stored procedure. Then the final recordset consists n recordsets and they are all closed. only the last one is open with rows inside. funny :))) |
 |
|
|
|
|
|