I am kind of new to SQL Server.
I am trying to shrink my MDF files, however I am unable to do it.
There is no error message. Any idea why this is the case ?
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. It only takes a minute to sign up.Sign up to join this community
Without more more information it might be hard to diagnose this - however, usually the only reason why a shrink wouldn't work (but completes, no errors and doesn't hang) is because there is no free space to release anywhere.
The only way to reduce the size on disk therefore is to delete data.
Run sp_spaceused to find out how much your database is actually taking up. If it's occupying all (or most) of the space on disk, then your shrink operation won't do anything - there's nothing to shrink.
NB (almost tempting to put this at the top, but I thought I'd answer the question first):
If this is on a dev environment, then you're probably OK to play around and try this out.
However, if you're doing this in production - don't.
It's a long quoted (for good reason) fact that shrinking a db is pretty much the worst thing you can do. Performance suffers for the sake of space that you could very well just use up again at some point - and disks are cheap.