one solution you may already know is
while you are getting work orders, put the orders/document id in a temp z table.
while you are running the second fetch, you can have better performance.
one solution you may already know is
while you are getting work orders, put the orders/document id in a temp z table.
while you are running the second fetch, you can have better performance.