HiveBrain v1.2.0
Get Started
← Back to all entries
patternMinor

tsql to know when a database was last shrunk

Submitted by: @import:stackexchange-dba··
0
Viewed 0 times
tsqllastshrunkknowdatabasewhenwas

Problem

In SQL 2000, 2005 and 2008, how can I know when databases were last shrunk on a MS SQL server?

I want to do this using TSQL.

Regards

Manjot

Solution

Because for shrinking of database one uses DBCC SHRINKDATABASE or DBCC SHRINKFILE, you can try to solve your problem with server audits from the group DBCC_GROUP (see http://technet.microsoft.com/en-us/library/cc280663.aspx and http://msdn.microsoft.com/en-us/library/cc280386.aspx)

Context

StackExchange Database Administrators Q#11326, answer score: 2

Revisions (0)

No revisions yet.