• Very ingenious, but honestly, the proliferation of procs isn't a good thing.

    This is better handled as others have said in client code where one class can dynamically generate all the needed code at run time.

    This avoids all types of issues and allows you to keep all the code in the same place - business logic, data validation, etc.

    Still, it is very ingenious, I just think less effort would be involved in the long run by keeping such code out of the database.