title: Dbcc Shrinkfile command
body: <p>We have a database with multiple filegroups and one of the filegroup is huge about 20tb mdf file and we want to shrink that file as it says unused space is 15tb. If we use the below shrink command it will take forever to shrink the file.</p>
  <p>USE UserDB;
  GO
  DBCC SHRINKFILE (DataFile1, SizeinMB);
  GO</p>
  <p>wanted to know how can we shrink the 20tb file in small parts of say 500gb. If someone can help me with a tsql code or help we with how to do the same it would be great. Thank you</p>