DECLARE @filename NVARCHAR(1000);
DECLARE @bc INT;
DECLARE @ec INT;
DECLARE @bfn VARCHAR(1000);
DECLARE @efn VARCHAR(10);
— Get the name of the current default trace
SELECT @filename = CAST(value AS NVARCHAR(1000))
FROM ::fn_trace_getinfo(DEFAULT)
WHERE traceid = 1 AND property = 2;
— rip apart file name into pieces
SET @filename = REVERSE(@filename);
SET @bc = CHARINDEX(‘.’,@filename);
SET @ec = CHARINDEX(‘_’,@filename)+1;
SET @efn = REVERSE(SUBSTRING(@filename,1,@bc));
SET @bfn = REVERSE(SUBSTRING(@filename,@ec,LEN(@filename)));
— set filename without rollover number
SET @filename = @bfn + @efn
— process all trace files
SELECT
ftg.StartTime
,te.name AS EventName
,DB_NAME(ftg.databaseid) AS DatabaseName
,ftg.Filename
,(ftg.IntegerData*8)/1024.0 AS GrowthMB
,(ftg.duration/1000)AS DurMS
FROM ::fn_trace_gettable(@filename, DEFAULT) AS ftg
INNER JOIN sys.trace_events AS te ON ftg.EventClass = te.trace_event_id
WHERE (ftg.EventClass = 92 — Date File Auto-grow
Discover more from Technology with Vivek Johari
Subscribe to get the latest posts sent to your email.
… [Trackback]
[…] Read More Info here on that Topic: techmixing.com/2015/01/t-sql-script-to-find-growth-size-of.html […]
… [Trackback]
[…] Find More on that Topic: techmixing.com/2015/01/t-sql-script-to-find-growth-size-of.html […]
… [Trackback]
[…] Here you can find 234 more Info on that Topic: techmixing.com/2015/01/t-sql-script-to-find-growth-size-of.html […]
… [Trackback]
[…] Find More on that Topic: techmixing.com/2015/01/t-sql-script-to-find-growth-size-of.html […]
… [Trackback]
[…] Find More on on that Topic: techmixing.com/2015/01/t-sql-script-to-find-growth-size-of.html […]
… [Trackback]
[…] Find More on that Topic: techmixing.com/2015/01/t-sql-script-to-find-growth-size-of.html […]
… [Trackback]
[…] Find More Info here to that Topic: techmixing.com/2015/01/t-sql-script-to-find-growth-size-of.html […]
… [Trackback]
[…] There you will find 830 additional Information on that Topic: techmixing.com/2015/01/t-sql-script-to-find-growth-size-of.html […]
… [Trackback]
[…] Read More Info here to that Topic: techmixing.com/2015/01/t-sql-script-to-find-growth-size-of.html […]
… [Trackback]
[…] Find More Info here on that Topic: techmixing.com/2015/01/t-sql-script-to-find-growth-size-of.html […]
… [Trackback]
[…] Here you can find 68407 more Information to that Topic: techmixing.com/2015/01/t-sql-script-to-find-growth-size-of.html […]
… [Trackback]
[…] Info on that Topic: techmixing.com/2015/01/t-sql-script-to-find-growth-size-of.html […]
… [Trackback]
[…] Info to that Topic: techmixing.com/2015/01/t-sql-script-to-find-growth-size-of.html […]
… [Trackback]
[…] Here you will find 58925 more Info on that Topic: techmixing.com/2015/01/t-sql-script-to-find-growth-size-of.html […]
… [Trackback]
[…] There you will find 68905 additional Info on that Topic: techmixing.com/2015/01/t-sql-script-to-find-growth-size-of.html […]
… [Trackback]
[…] Read More Information here to that Topic: techmixing.com/2015/01/t-sql-script-to-find-growth-size-of.html […]
… [Trackback]
[…] Find More to that Topic: techmixing.com/2015/01/t-sql-script-to-find-growth-size-of.html […]
… [Trackback]
[…] Info to that Topic: techmixing.com/2015/01/t-sql-script-to-find-growth-size-of.html […]
… [Trackback]
[…] Read More to that Topic: techmixing.com/2015/01/t-sql-script-to-find-growth-size-of.html […]
… [Trackback]
[…] Find More on to that Topic: techmixing.com/2015/01/t-sql-script-to-find-growth-size-of.html […]
… [Trackback]
[…] Find More here on that Topic: techmixing.com/2015/01/t-sql-script-to-find-growth-size-of.html […]
… [Trackback]
[…] Info on that Topic: techmixing.com/2015/01/t-sql-script-to-find-growth-size-of.html […]
… [Trackback]
[…] Find More on to that Topic: techmixing.com/2015/01/t-sql-script-to-find-growth-size-of.html […]
… [Trackback]
[…] Read More on on that Topic: techmixing.com/2015/01/t-sql-script-to-find-growth-size-of.html […]
… [Trackback]
[…] Find More to that Topic: techmixing.com/2015/01/t-sql-script-to-find-growth-size-of.html […]
… [Trackback]
[…] Info to that Topic: techmixing.com/2015/01/t-sql-script-to-find-growth-size-of.html […]
… [Trackback]
[…] Info to that Topic: techmixing.com/2015/01/t-sql-script-to-find-growth-size-of.html […]
… [Trackback]
[…] Info on that Topic: techmixing.com/2015/01/t-sql-script-to-find-growth-size-of.html […]
… [Trackback]
[…] Here you will find 20347 additional Information to that Topic: techmixing.com/2015/01/t-sql-script-to-find-growth-size-of.html […]
… [Trackback]
[…] Info to that Topic: techmixing.com/2015/01/t-sql-script-to-find-growth-size-of.html […]
… [Trackback]
[…] Here you can find 37438 more Information to that Topic: techmixing.com/2015/01/t-sql-script-to-find-growth-size-of.html […]
… [Trackback]
[…] Find More here to that Topic: techmixing.com/2015/01/t-sql-script-to-find-growth-size-of.html […]