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 have a SQL Server 2008 DB. I store mainly text data in it, but also inserted some blobs in it. The size of the DB increased. Now I deleted the blobs, but it seems that the size of the DB stayed the same. How can I make it shrink?

share|improve this question

migrated from stackoverflow.com Feb 11 '11 at 0:21

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

add comment

5 Answers

There is a Shrink option available in the context menu of the database in the SQL Server Management Studio.

More information

share|improve this answer
add comment

There is an option to shrink either database or database file. You right-click on the database in management studio -> tasks -> Shrink

share|improve this answer
add comment

from BOL:

DBCC SHRINKDATABASE (UserDB, 10); 
GO

where UserDB is your database name and 10 is the percentage of free space you want to leave.

Using SHRINKDATABASE has performance implications, you can read about them from this question on StackOverflow.

share|improve this answer
add comment

How big is yours t-log file,maybe you only need shrink t-log,it doesn't matter if your delete some of rows from your databse,because that transactions will probably go to t-log.

share|improve this answer
add comment

The DB dosn't shrink automaticaly, but you have now some free space in de file. So if you will save some text in the future, the database the database will grow again when no free space is available any more.

If you really what to shrink it: right click on DB \ tasks \ shrink will to what you want.

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.