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.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 Using EOF in a SP

Author  Topic 

yossibaram
Yak Posting Veteran

82 Posts

Posted - 2002-10-31 : 10:21:12
Hi,
I am converting my VB app from Access to sql server.
Many times in my code i use
Do Until recordset.EOF
....
....
recordset.MoveNext
Loop
Can i create the same loop in a SP??
Thanks
Yossi

robvolk
Most Valuable Yak

15732 Posts

Posted - 2002-10-31 : 10:23:25
Sure, if you want it to perform very, very badly.

Can you post the code you're trying to convert, and a description of what you're trying to accomplish with it?

Edited by - robvolk on 10/31/2002 10:24:18
Go to Top of Page

yossibaram
Yak Posting Veteran

82 Posts

Posted - 2002-10-31 : 10:32:25
Hi an example:
Do Until recordset.EOF

call SP_2 buff

recordset.MoveNext
Loop

This small ex runs through a recordset and call each time a second SP that do a manipulation on the record.

Thanks
Yossi





quote:

Sure, if you want it to perform very, very badly.

Can you post the code you're trying to convert, and a description of what you're trying to accomplish with it?

Edited by - robvolk on 10/31/2002 10:24:18



Go to Top of Page

mr_mist
Grunnio

1870 Posts

Posted - 2002-10-31 : 10:37:01

If you post the procedure that is actually called, or explain what the manipulation is, folk might be able to recode it to work without using a loop.

Go to Top of Page

yossibaram
Yak Posting Veteran

82 Posts

Posted - 2002-10-31 : 11:03:10
Hi,
Sorry for not clarifying myself.
SP_2 contains - Print #FileName , fileld1 & field2....

All i need to do is looping inside a specific recordset and print each record as a line into a text file.

If you have any sugestion please advice.
Do you never loop a recordset?

Thanks

Yossi
quote:


If you post the procedure that is actually called, or explain what the manipulation is, folk might be able to recode it to work without using a loop.





Go to Top of Page

robvolk
Most Valuable Yak

15732 Posts

Posted - 2002-10-31 : 11:12:13
I never loop a recordset. Haven't done a recordset loop in over 3 years.

If you need to output data from a table into a text file, check out bcp or DTS:

http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=21175

You can use the queryout setting to output only the columns you need.

Go to Top of Page

yossibaram
Yak Posting Veteran

82 Posts

Posted - 2002-10-31 : 11:17:10
In time (not much i hope),
I will improove my design skills.
I will check into your advise.
Thanks abunch
Yossi

quote:


I never loop a recordset. Haven't done a recordset loop in over 3 years.

If you need to output data from a table into a text file, check out bcp or DTS:

http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=21175

You can use the queryout setting to output only the columns you need.





Go to Top of Page
   

- Advertisement -