After that I have to use the values there from the @array_c to do another DB query
In addition to the previous comments..
Can you combine that second (looped) DB query into the first query?
That will considerably reduce the overall time since there will be fewer calls to the DB.
In reply to Re^3: Efficiency on Code
by nedals
in thread Efficiency on Code
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |