PeteEngineer
asked on
For each without temp table in T-SQL
Is there any way that i can use a "For-Each" for each rows of a selected query ..without using a temp table in my T-SQL stored procedure?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Explain your exact requirement.
Raj
Raj
ASKER
yes need to iterated for all the sales item in my table.
But i can do it is very little number but what about i lakh items?
it takes hell lot of memory .. since it is putting the item into temp table and take it back
rather it can be done with a for each or cursor or something will it take the same amount of memory?
But i can do it is very little number but what about i lakh items?
it takes hell lot of memory .. since it is putting the item into temp table and take it back
rather it can be done with a for each or cursor or something will it take the same amount of memory?
"yes need to iterated for all the sales item in my table."
you doing for update or insert?
try to make single query and avoid loop if possible.
if its 1 lakh rows, surely it going to slow.
if u can discuss more in detail then experts can help u to make single query.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
is there anyway that i can tweak this ?
using a foreach or cursor or something else?