Advertisement

02.05.2008 at 02:50PM PST, ID: 23139711
[x]
Attachment Details

Best Practice in Looping through the rows in a table

Asked by singhch in SQL Query Syntax

Tags: SQL

Hi there,

What is the best practice when it comes to iterating thru each row in a table?  Do I have to use CURSORS to achieve this or is there a better/more efficient way to do this?

I understand that using CURSORS is not a good programming practice.

For example, if I have a table that contains 500 rows or even maybe 5 million rows and i want to loop thru each row and then based on some logic as to perform some task.

thanks
Start Free Trial
[+][-]02.05.2008 at 03:22PM PST, ID: 20828201

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: SQL Query Syntax
Tags: SQL
Sign Up Now!
Solution Provided By: JimBrandley
Participating Experts: 1
Solution Grade: B
 
 
[+][-]02.05.2008 at 05:53PM PST, ID: 20828886

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628