Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

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

share|improve this question
    
If there's still time to talk you out of shrinking your db, consider this: sqlskills.com/BLOGS/PAUL/post/… –  Michael Haren May 13 '10 at 3:55
    
I am against shrinking, so this is to find if someone has done it. –  Manjot May 13 '10 at 4:04
    
Ah, interesting...I'm curious to see what people come up with –  Michael Haren May 13 '10 at 4:08
    
I have scripts for 2005 and above but not for sql 2000. So I am interested in something that can be applied to all environments. See sqlblog.com/blogs/jonathan_kehayias/archive/2009/05/13/… –  Manjot May 13 '10 at 4:17
1  
surely the only people with sufficient access to shrink a DB are admins? That narrows it down a bit... –  Mitch Wheat May 13 '10 at 4:56
add comment

migrated from stackoverflow.com Jan 22 '12 at 14:39

This question came from our site for professional and enthusiast programmers.

1 Answer

up vote 1 down vote accepted

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)

share|improve this answer
    
can i use it on sql 2000? –  Manjot May 16 '10 at 21:53
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.