Viewing post 1 (of 2 total)
You could capture the SQL statements in a variable and then execute it:
DECLARE @sql nvarchar(max);
SET @sql = '';
SELECT @sql +='DROP TABLE [' + s.name + '].[' +tab.name + '];'...
September 22, 2016 at 8:01 am
#1902475