title: How to import an Excel file with dynamic worksheet name ? (T-SQL)
body: <p>I basically set a procedure that imports from Excel to SQL in T-SQL:</p>
  
  <pre><code>SELECT *  FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0','Excel 8.0;HDR=YES;Database=C:\report.xls','select * from [name555$]')
  </code></pre>
  
  <p>The name555 consists of a fixed name, and the 555 from what appears to be a random three digits number. When the report comes to me, sometimes the name is 555, sometimes it's 439, 390 etc.</p>
  
  <p>Is there a way to instruct SQL server (preferrably in T-SQL as that's what I'm using right now) to read the name dynamically? It's the only sheet in the XLS file but it</p>
  
  <p>For example in VBA you can use the sheet as a name1$ name or as a "sheet1$" index. Well, I hope somebody can help with this :)</p>