in reply to Re^2: Efficiency on Code
in thread Efficiency on Code

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.