$ 0 0 Yep - you're right the dynamic SQL is superfluous. Odd this hasn't been found before - seems a very basic flaw.