title: sql insert query through text file
body: <p>I'm trying to insert data from excel sheet to sql database. The query is stored in a text file as follows: </p>
  
  <pre><code>insert into [demo].[dbo].[relative] 
  select *  
  from openrowset('Microsoft.Jet.OLEDB.4.0','Excel 8.0;Database=D:\relative.xls','select * from [sheet1$]'); 
  </code></pre>
  
  <p>When I am executing the following command:</p>
  
  <pre><code>sqlcmd -S ADMIN-PC/SEXPRESS -i d:\demo.txt.
  </code></pre>
  
  <p>it is showing this error:</p>
  
  <blockquote>
    <p>Msg 7357, Level 16, State 2, Server ADMIN-PC\SEXPRESS, Line 1    </p>
  </blockquote>
  
  <p>Can anyone please help in rectifying my problem.</p>