Sql-server – Reclaim unused space

sql server

I have a DB 150 GB , contains 138 tables one of the tables is 120 GB. I need to archive around 80 GB from this table. Is there a way to reclaim this space without using DB shrink?

thanks

Best Answer

There is no other way than shrinking a db to claim back unused space. No matter if you truncate or delete data or update with smallers length of data, the .mdf file will stay the same size. Which is good, because shrinking has negative side effects such as fragmentation of files and indexes.

If that table you are archiving later on grows again to the bigger size shrinking will not be a good option here. It's better to have that space already allocated rather than do heavy IO operations on the sub system in some days again. If you know that this table will not grow that big, because you put some maintenance in place, shrink that db once and be prepared to rebuild your indexes.