I have recently migrated tables to their own filegroups and now the primary file group is too large. The initial size of the primary data file (.mdf) is 150GB. I want to reduce this to say 40GB.
DBCC SHRINKFILE doesn't work because it can't go below 150GB. I've done it with an emptyfile and it won't empty it because its the primary file. ALTER DATABASE doesn't work because the file isn't empty. It looks like I need to create a new database and transfer the data??
There must be another way, any suggestions SSC?
asked Nov 18, 2009 at 06:33 PM in Default
If you try to shrink it with the size specified as 0 or without a specifified size, then it will target that databases default which is what it was created at. However, if you specify your target size, like:
Then it will come as close to your specified target as it can and should happily go below the size it was created with, and that will reset that databases default size. Of course, it will not go below what is actually needed to store the current data.
If this is not working for you, can you please provide the exact commands you are using and any messages?
answered Nov 18, 2009 at 08:44 PM