• One more minor add-on:

    I wrote a similar stored procedure that allows me to pass in a stored procedure name and parameters and it would write the results to a table. I've used it several times to test the results from a new stored procedure against the results from an existing stored proc. All of the data gets put into tables and then you can use checksums to verify that the data in each table is exactly the same. It's a great way to unit test code changes.

    Since this happens on dev servers not production, changing the config settings is not a problem.

    Paul