Reclaiming unallocated space from tempdb database in SQL Server Express 2012 I need to reclaim space from tempdb database which has more than 50 GB unallocated space. I have tried DBCC SHRINKDATABASE but it didn't do anything. Please note, I am aware that it has performance implications but I have no choice. I run SQL Server Express on a laptop and really need this 50 GB space. Also I have tried restarting SQL Server/laptop and have ensured that no process is running right now.
I have done it using


  DBCC SHRINKFILE ('tempdev',10)


Somehow DBCC SHRINKDATABASE was not working. Even DBCC SHRINKFILE ('tempdev',0) or DBCC SHRINKFILE ('tempdev') doesn't work. We have to assign some figure in MB to which it will shrink the database to.