Skip to content

Commit

Permalink
Update query 🆕
Browse files Browse the repository at this point in the history
  • Loading branch information
blakedrumm authored Sep 8, 2023
1 parent 12ca22c commit ff03181
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
DECLARE @sql NVARCHAR(MAX) = '';



SELECT @sql += 'DROP STATISTICS ' + QUOTENAME(OBJECT_SCHEMA_NAME(s.object_id)) + '.' + QUOTENAME(OBJECT_NAME(s.object_id)) + '.' + QUOTENAME(s.name) + ';' + CHAR(13)
FROM sys.stats s
WHERE s.name LIKE 'PRE\_%' ESCAPE '\' OR s.name LIKE 'POST\_%' ESCAPE '\';
WHERE s.name LIKE 'PRE\_%' ESCAPE '\' OR s.name LIKE 'POST\_%' ESCAPE '\' OR s.name LIKE 'InstallDate\_%' ESCAPE '\';



EXEC sp_executesql @sql;

0 comments on commit ff03181

Please sign in to comment.