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 of a Query

Author  Topic 

khufiamalik
Posting Yak Master

120 Posts

Posted - 2008-09-08 : 02:46:04
Hello All,
I have a query Like

Select * From Table1

and multiple rows will be selected.

I want to iterate through each and every row but dont want to use Cursor.
Is there any way to do this ? OR I have to use Cursor only

Thanks.

sunil
Constraint Violating Yak Guru

282 Posts

Posted - 2008-09-08 : 02:51:29
Whats your requirement? What you want to do by iterating result set? Please provide more information.
Go to Top of Page

khufiamalik
Posting Yak Master

120 Posts

Posted - 2008-09-08 : 02:53:43
Actually I want to get each and every record and on the basis of each record i want to fill another table but before filling other table i have to perform some calculation.

Can I use a loop , if yes then How?
Go to Top of Page

khufiamalik
Posting Yak Master

120 Posts

Posted - 2008-09-08 : 02:53:44
Actually I want to get each and every record and on the basis of each record i want to fill another table but before filling other table i have to perform some calculation.

Can I use a loop , if yes then How?
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2008-09-08 : 03:06:52
quote:
Originally posted by khufiamalik

Actually I want to get each and every record and on the basis of each record i want to fill another table but before filling other table i have to perform some calculation.

Can I use a loop , if yes then How?


Post some sample data and the result you want

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -