Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I need more space in my development environment and need to shrink my database (or files) in SQL Server. Should I chose "shrink files" or "shrink database" to free most disk space?

Shrink options in SQL Server

share|improve this question
add comment

2 Answers 2

up vote 1 down vote accepted

If the database contains more than one data file, with the "Shrink Files" options you can choose which file you want to shrink; "Shrink Database" will shrink all of them.

share|improve this answer
    
Thanks, just what I needed. Does this inclide LOG-files? –  Benny Skogberg Nov 7 '12 at 9:59
    
Yes, but they will only be shrunk if there are inactive logs on them, i.e. if the DB is set to simple recovery model or if a transaction log backup has been performed. –  Massimo Nov 7 '12 at 10:35
add comment

Its like

ShrinkDatabase: shrink all files in a database

ShrinkFile: just one file

Shrink Database shrinks all the files in the database, shrink file shrinks only the specified file. For more info you can go to this link also

http://sqlinthewild.co.za/index.php/2007/09/08/shrinking-databases/

share|improve this answer
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.