title: Node MSSQL incorrect syntax near '@input_parameter'
body: <p>I've been stuck with this error for about a day now</p>
  
  <p>I'm using node.js with html form where the input type=checkbox and i want mssql to use the data posted form the form to query</p>
  
  <p>Let's say with</p>
  
  <pre><code>postData = [ '1','2','3','4','5' ]
  </code></pre>
  
  <p>The JS code:</p>
  
  <pre><code>var cfg = {
  user: 'user',
  password: '1234',
  server: 'COMPUTERNAME\\SQLEXPRESS',
  port: '1433',
  database: 'test',
  pool: {
      max: 20,
      min: 0,
      idleTimeoutMillis: 30000
   }
  };
  
  app.post('/select', urlencodedParser, function (req, res){
  
  var in_dt = String();
  
  for (var i = 0; i &lt; req.body.postData.length; i++) {
   if (i==0) {
    in_dt += ("('" + req.body.postData[i] + "'")
   }else if (i==((req.body.postData.length)-1)) {
    in_dt += (", '" + req.body.postData[i] + "')")
   }else {
    in_dt += (", '" + req.body.postData[i] + "'")
   }
  };
  
  
  sql.connect(cfg).then(pool =&gt; {
    return pool.request()
    .input('input_parameter', sql.NVarChar, in_dt)
    .query('SELECT * FROM [test].[dbo].[Table1] where ID IN @input_parameter')
  }).then(result =&gt; {
  
    res.render('select', { qDt: result.recordset });
  
    sql.close()
  }).catch(err =&gt; {
    console.log(err);
  })
  
  sql.on('error', err =&gt; {
    console.log(err);
  })
  
  });
  </code></pre>
  
  <p>It gave me </p>
  
  <blockquote>
    <p>Incorrect syntax near '@input_parameter'<br>
    code: 'EREQUEST'<br>
    state: 1<br>
    class: 15<br></p>
  </blockquote>
  
  <p>But when i copy the query and the data to run in SSMS it was fine</p>
  
  <p>Can you help me find where the error is and maybe fix it?</p>