Does anyone know the diff between shrink database or file? and what would the pros and cons? in what circumstances you wish to do either one?

thanks

link|improve this question
feedback

migrated from stackoverflow.com Sep 8 '10 at 14:57

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

2 Answers

up vote 3 down vote accepted

Basically, DBCC SHRINKFILE shrinks one file, but DBCC SHRINKDATABASE shrinks all files. This is well documented in Books Online: see the entry for DBCC SHRINKDATABASE. The sections "How DBCC SHRINKDATABASE works" and "Best practices" should answer your questions.

link|improve this answer
feedback

As for some pros/cons, read this article from Paul Randal, and his advice against SHRINKDATABASE. Just throwing it out there for you.

link|improve this answer
nice article but not what i'm after – user53735 Sep 9 '10 at 0:54
1  
btw.. is there a way to fix fragmentation after shrink the database? – user53735 Sep 9 '10 at 0:56
feedback

Your Answer

 
or
required, but never shown

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