4

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

5
  • If there's still time to talk you out of shrinking your db, consider this: sqlskills.com/BLOGS/PAUL/post/… Commented May 13, 2010 at 3:55
  • I am against shrinking, so this is to find if someone has done it.
    – Manjot
    Commented May 13, 2010 at 4:04
  • 1
    Ah, interesting...I'm curious to see what people come up with Commented May 13, 2010 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
    Commented May 13, 2010 at 4:17
  • 1
    surely the only people with sufficient access to shrink a DB are admins? That narrows it down a bit... Commented May 13, 2010 at 4:56

1 Answer 1

2

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)

1
  • can i use it on sql 2000?
    – Manjot
    Commented May 16, 2010 at 21:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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