DECLARE @Stmt NVARCHAR(MAX) = '' SELECT @Stmt = @Stmt + 'DROP TABLE [' + SCHEMA_NAME(t.schema_id) + '].[' + t.name + '];' FROM sys.[tables] t WHERE t.[type] = 'U' EXECUTE(@Stmt) GO
DECLARE @Stmt NVARCHAR(MAX) = '' SELECT @Stmt = @Stmt + 'DROP TABLE [' + SCHEMA_NAME(t.schema_id) + '].[' + t.name + '];' FROM sys.[tables] t WHERE t.[type] = 'U' EXECUTE(@Stmt) GO