• I can tell you that SSIS packages can generate code that looks very similar to what you are asking about.

    If you have SSIS in your environment, Id start with those folks.