Poking about with dynamic SQL stuff.