• Can you post your code that actually builds and runs these queries? Also, you may not need two dynamic queries, one to get the count and a second to do the update but it is a bit difficult to figure out, at least for me, from the code you have posted.