title: Get each file size inside a Folder using SQL
body: <p>We are keeping images in Folder which can have images &amp; sub folder &amp; these sub folders can also have images &amp; sub folders for example</p>
  
  <pre><code>c:\myImageFolder\image1.png    //'myImageFolder' have image
  c:\myImageFolder\Folder1\imagex.png // 'myImageFolder' have another folder inside which is 'Folder1'.
  c:\myImageFolder\Folder1\ChildFolder1\imagen.png // 'myImageFolder' have 'Folder1' which have 'ChildFolder1' which have imagen.png
  </code></pre>
  
  <p>We need to know that how many images are in there over 1 MB, over 750KB and 500KB?</p>
  
  <p>Some facts:</p>
  
  <ul>
  <li>We need to do it through SQL</li>
  <li>We are using SQL Server 2008</li>
  <li><code>myImageFolder</code> contains more than thousands sub folders</li>
  <li><code>myImageFolder</code> size is nearly 5 GB</li>
  </ul>
  
  <p>Thanks in advance for your valuable time &amp; help.
  <strong>Note:</strong> <strong><a href="https://stackoverflow.com/questions/7952406/get-each-file-size-inside-a-folder-using-sql/7958070#7958070">I found the solution, you can find it here</a></strong></p>