title: How to fix 'Incorrect syntax near '@P1'.' error in Laravel
body: <p>While trying to call a stored procedure function in Laravel, I keep getting this error</p>
  
  <blockquote>
    <p>SQLSTATE[42000]: [Microsoft][ODBC Driver 13 for SQL Server][SQL Server]Incorrect syntax near '@P1'. (SQL: exec TestProcedure(울산광역시, 남구, 신정동))</p>
  </blockquote>
  
  <p>Note that in SSMS this stored procedure works fine when I pass the variables, which are, city, county, and address. </p>
  
  <p>Here is my code in Laravel; </p>
  
  <pre><code>public function filterKoreanAddress(Request $request)
  {
      $data = $request-&gt;all();
      $results = DB::select(
          'exec TestProcedure(?, ?, ?)',
          [
              $request-&gt;input('city'),
              $request-&gt;input('county'),
              $request-&gt;input('address'),
          ]
      );
      dd($results);
  }
  </code></pre>
  
  <p>So, did I do anything wrong in the code?</p>