juniorDBA13 - Wednesday, December 20, 2017 6:42 AM
This is a form of "Death by SQL" no matter how you do it. Perhaps if you explained why there's a need to do such a thing and what the script(s) will actually do, we might be able to recommend a much safer method.
--Jeff Moden
Change is inevitable... Change for the better is not.