title: Is it safe to reduce TFS DB size by using Delete stored procedures?
body: <p>We have TFS 2017.3 and the database it's huge - about 1.6 <strong>TB</strong>.</p>
  
  <p>I want to try to clean up the space by running these 2 stored procedures:</p>
  
  <ul>
  <li>prc_CleanupDeletedFileContent</li>
  <li>prc_DeleteUnusedFiles</li>
  <li>prc_DeleteUnusedContent</li>
  </ul>
  
  <p>Is it safe to run it?
  Is there a chance that it will delete important things I am currently using? (of course, I will do a backup before...)</p>
  
  <p>What are the best values to put in these stored procedures?</p>
  
  <p>Another thing - If I run this query:</p>
  
  <pre><code>SELECT A.[ResourceId]  
  FROM [Tfs_DefaultCollection].[dbo].[tbl_Content] As A
  left join [Tfs_DefaultCollection].[dbo].[tbl_FileMetadata] As B on A.ResourceId=B.ResourceId
  where B.[ResourceId] IS Null
  </code></pre>
  
  <p>I got result of 10681.
  If I run this query:</p>
  
  <pre><code>SELECT A.[ResourceId]  
  FROM PTU_NICE_Coll.[dbo].[tbl_Content] As A
  left join PTU_NICE_Coll.[dbo].tbl_FileReference As B on A.ResourceId=B.ResourceId
  where B.[ResourceId] IS Null
  </code></pre>
  
  <p>I got result of 10896.</p>
  
  <p>How can I remove this rows? and is it completely safe to remove them?</p>