You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
EXEC dbo.sp_ineachdb @command ='INSERT INTO tempdb.dbo.UserCreatedStats SELECT ''?'' AS [Database], schema_name(T.schema_id) AS SchemaName, object_name(S.object_id) AS TableName, S.name AS StatisticsName, ''USE '' + ''?'' + ''; DROP STATISTICS ['' + schema_name(T.schema_id) + ''].['' + object_name(S.object_id) + ''].['' + S.name + '']'' AS DropStatement FROM sys.stats AS S INNER JOIN sys.tables AS T ON T.object_id = S.object_id WHERE user_created = 1',
14
+
EXEC dbo.sp_ineachdb @command ='
15
+
INSERT INTO tempdb.dbo.UserCreatedStats
16
+
SELECT DB_NAME() AS [Database], schema_name(T.schema_id) AS SchemaName, object_name(S.object_id) AS TableName, S.name AS StatisticsName,
-- Find tempdbs with uneven initial size or growth
2
+
-- Part of the SQL Server DBA Toolbox at https://github.com/DavidSchanzer/Sql-Server-DBA-Toolbox
3
+
-- This script generates an explanatory sentence if there are multiple size, growth or is_percent_growth values on tempdb data files.
4
+
1
5
SELECT'The tempdb database has multiple data files in one filegroup, but they are not all set up with the same initial size or to grow in identical amounts. This can lead to uneven file activity inside the filegroup.'
0 commit comments