updated Contact SQL generation