If I don't already have any logging in place, is there any way to use the DMVs or anything else on SQL Server to determine which query / event caused my database's last grow operation?
1 Answer
You could use the undocumented function sys.fn_dblog
filtering by the collumn transaction name like this:
SELECT [Transaction Name]
FROM sys.fn_dblog(NULL,NULL)
WHERE [Transaction Name] IS NOT NULL;
On the query result you should look for SetFileSize
The line before the SetFileSize will show the last event that occured to cause the growth.