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. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have DB backup with size approx. 150 Mb.

I am trying to restore it and getting an error: "System.Data.SqlClient.SqlError: There is insufficient free space on disk volume 'C:\' to create the database. The database requires 67771760640 additional free bytes, while only 45085224960 bytes are available. (Microsoft.SqlServer.Smo)"

Restore is about to create DB with much bigger size than backup has. Is there a possibility to reduce size of DB being restored?

share|improve this question
If the backup was compressed, then your actual database may be 67 GB... – JNK Jul 16 '12 at 13:15
@JNK, can I somehow find out it backup was compressed? – Gopher Jul 16 '12 at 13:18
Use RESTORE HEADERONLY -- there is a column Compressed that will be 0 or 1. – Jon Seigel Jul 16 '12 at 13:21
up vote 4 down vote accepted

A restore always restores the files to the same sizes they were when they were backed up.

There is currently no way to "restore with shrink."

You'll need to restore the files to a drive with sufficient free space, and perhaps consider shrinking the files at that point, then use your preferred technique to move the files to the spot you want.

share|improve this answer
Alter database + set offline + move files manually + set online is much, much safer than detach + move + attach. – Aaron Bertrand Jul 16 '12 at 13:32
@Aaron: Yes, true; thanks. – Jon Seigel Jul 16 '12 at 13:41

Your Answer


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.