Generate update and Insert SQL Statements