Update the SQL scripts to use procedures
Update the SQL scripts to use procedures