Went to explicit var-substitution for the dynamic sql queries, makes formatting easier.