• I seem to remember that there is a non-documented stored procedure that runs the resultset of a query.

    In some situations I do build up a string of commands and then execute that string but I am always mindful of the limited string processing available within SQL Server.

    In SQL2000 sp_executeSQL required an NVARCHAR argument which meant that any statement had to be under 4,000 characters long.

    EXEC required a VARCHAR which meant a limit of 8,000 characters.

    Of course, now in SQL2005 we have VARCHAR(MAX) and NVARCHAR(MAX) to play with.