title: Importing Excel to SQL Server from the backend
body: <p>I have a ton of excel files which I'm trying to import to SQL Server from the backend and then automate it using a batch file.</p>
  
  <p>I know that we can use OPENROWSET inside a T-sql script and load the excel files. I'm also aware of using SQLCMD or BCP options. All of these will work for excel sheets which are straightforward grids.</p>
  
  <p>However, the challenge is, I only need to load a specific region/range of excel cells from a sheet.
  For example: if the sheet has the below info, I need to only load the below columns:</p>
  
  <pre><code>    Date, Group1, Group2 and Group 3 
  </code></pre>
  
  <p>until it hits the "Blank Row" and ignore everything below it.</p>
  
  <pre><code>              Date   Group1 Group2 Group 3
                Jan-13  25     26      27
                Jan 18  35     29      19
                               20      15          
            &lt;empty row&gt;          &lt;empty row&gt;
  
                 Y/Y %  YTD %  Group %
                 15      20     40  
  </code></pre>
  
  <p>So, my question is: is it possible to implement this functionality using OPENROWSET in T-SQL? IF so, can you please point me to any links/example on how I can do this? I tried digging around a bit on the MSDN site but couldn't find any.</p>
  
  <p>If this cannot be done in T-SQL, any ideas on how I could implement it from the backend?</p>
  
  <p>Thanks in advance,
  Bee</p>