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 2005 Forums
 Transact-SQL (2005)
 How to Iterate through Result given by SP

Author  Topic 

khufiamalik
Posting Yak Master

120 Posts

Posted - 2008-09-03 : 00:34:05
Hello All,
I have a SP that gives me Multiple Rows like

Exec MySpName

Col1 Col2 Col3
1 2 9000.00
2 4 1500.00
3 3 300.00


Can any one help me that how can I iterate through the result given by a SP

Thanks in Advance
I just want to iterate these rows.

Can any one

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2008-09-03 : 00:36:08
basically you insert the result into temp table then use While loop or cursor to iterate the rows from the temp table.


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page

Vinnie881
Master Smack Fu Yak Hacker

1231 Posts

Posted - 2008-09-03 : 00:41:16
Also, a lot of times you don't need to iterate through anything in sql. What are you looking to do with the results?
Go to Top of Page
   

- Advertisement -