• Nice way to get it to work!

    I don't see why it shouldn't be used in production environment, it just needs to be a bit refined... I wouldn't include connection strings in the statement, but I don't see it nor dangerous nor unstable, connection strings apart.

    I coded something similar a couple of years ago to work around limitations on insert / exec, but I used CLR to achieve it, providing a connection key mapped to a small table holding connection information.

    -- Gianluca Sartori