I assume that this procedure would be used by database administrators on an as needed basis. This is not something which would run on database servers most of the time, but if performance is an issue, you could substitute the use of a temp table with a table datatype. Once the procedure is in place somewhere in a dbadmin or similar database where DBA scripts are kept, you can start using it, which would hopefully make DBA’s life much easier.
Published with the express written permission of the author. Copyright 2004