title: BULK INSERT with variable file name
body: <p>i am trying to bulk insert into Db using sql server 2005</p>
  
  <p>Below is the code. </p>
  
  <pre><code>declare @path varchar(500) 
  set @path = 'E:\Support\test.csv'; 
  
  Create table #mytable( name varchar(max), class varchar(max), roll varchar(max) )
  
  BULK INSERT #mytable FROM @path &lt;-- Error line
  WITH ( FIELDTERMINATOR = ',', ROWTERMINATOR = '\n' ); 
  Go 
  select * from #mytable
  drop table #mytable
  </code></pre>
  
  <p><strong>Problem</strong>: issue is that my file path is dynamic and comes from a variable instead of hard coding which is not working
  If i change the error line to below it works</p>
  
  <pre><code> BULK INSERT #mytable FROM 'E:\Support\test.csv'; 
  </code></pre>
  
  <p>Please advise how to fix this</p>