October 16, 2012 at 12:45 pm
We have a database with lab tests that we are going to merge with a different database. The original has 8,000,000 records. The new one can only bring in 100,000 at a time. I am copying the database, then deleting down to 100,000 records. However, the space on disk remains the same. Do I need to pack the database somehow to regain the space ?
Thanx !
October 16, 2012 at 4:09 pm
chilidogie (10/16/2012)
We have a database with lab tests that we are going to merge with a different database. The original has 8,000,000 records. The new one can only bring in 100,000 at a time. I am copying the database, then deleting down to 100,000 records. However, the space on disk remains the same. Do I need to pack the database somehow to regain the space ?Thanx !
Yes. Rebuild the clustered index to recover the table space and rebuild the non-clustered indexes to regain the index space.
--Jeff Moden
Change is inevitable... Change for the better is not.
October 18, 2012 at 8:48 am
Thanx Greatly !!!!
October 19, 2012 at 1:33 am
If you want to release space on disk then you need to shrink the database. See DBCC SHRINKDATABASE. Beware, though - if your database is likely to grow again then you're wasting resources by shrinking it, as well as causing internal and external fragmentation.
John
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply