title: Pass parameters to a procedure with SQLcmd
body: <p>I use this SQL command:</p>
  
  <pre><code> sqlcmd -v first_date="30/09/2015" last_date="15/09/2016"
  </code></pre>
  
  <p>The SQL execute:</p>
  
  <pre><code>DECLARE @return_value int
  
  EXEC    @return_value = [dbo].[_testProcedure]
  
  SELECT  'Return Value' = @return_value
  
  GO
  
  PRINT 'Finally'
  GO
  </code></pre>
  
  <p>And I would like to pass that parameters to a stored procedure:</p>
  
  <pre><code>ALTER PROCEDURE [dbo].[_testProcedure]
      WITH EXECUTE AS CALLER
  AS
  BEGIN
  
      DECLARE @F_FIRST_DATE_DT VARCHAR(50)
      DECLARE @F_LAST_DATE_DT VARCHAR(50)
  
      SET @F_FIRST_DATE_DT = N'$(first_date)'
      SET @F_LAST_DATE_DT = N'$(last_date)'
  </code></pre>
  
  <p>But it return me an error:</p>
  
  <blockquote>
    <p>Incorrect syntax near 'first_date'</p>
  </blockquote>
  
  <p>What is the correct way to pass variables to stored procedure?</p>