SQL query updates

Replaced CDC calls with straight SQL calls.