title: Bulk insert file path as stored procedure parameter
body: <p>I'm trying to create a stored procedure to import from <code>CSV</code>. Everything works if I have a hard coded file path, but I want to take a file path as a parameter. When I try SQL Sever Management Studio generates an error:</p>
  
  <blockquote>
    <p>Incorrect syntax near '@filePath'.</p>
  </blockquote>
  
  <p>(In fact, if I put anything but a pure string(eg. <code>'C:'+'/dir'</code>) it gives an error.)</p>
  
  <p>This is a simplified version of my code:</p>
  
  <pre><code>Create procedure [importFile](@filePath varchar(Max))
  AS
  BEGIN
      create table #Temp
      (
        row1 int,
        row2 varchar(5),
        row3 bit
      )
      BULK insert
        #Temp
        from @filePath
        With(
          FIELDTERMINATOR = ',',
          ROWTERMINATOR = '\n'
        )
      ...
  END
  </code></pre>
  
  <p>Any explanation?</p>