Searching for an automatic code generator
You are wanting a Template Based Code Generator.
I'm only aware of the ones for Oracle. However, the long term goal is to support multiple RDBMS. Consider these as "starting points" for what is really needed.
These are on GitHub
- FTLDBFTLDB is based on Apache FTL project. This might be your best starting point.
- "oddgen"
oddgen
is an addon for SQLDeveloper. It uses eXtend as the internal code generator. - tePLSQLtePLSQL is a pure PL/SQL code generator. I'm updating this one and would love to work with someone that is wanting to translate it to T-SQL.
EDIT : Additional Notes
It looks like you can use the client-side version of FTLDB
for any RDBMS that has a JDBC Driver. I haven't tried it, yet.