title: Running a stored procedure with NodeJS and MSSQL package error
body: <p>Im trying to get the MSSQL nodejs package to return the results of a stored procedure from Microsoft SQL server using the code below. However the error I get is...</p>
  
  <pre><code>[TypeError: Cannot read property 'type' of undefined]
  </code></pre>
  
  <p>I'm not sure I have done the inputs correctly as I couldn't find an example with more than one input anywhere online.</p>
  
  <p>Any ideas?</p>
  
  <pre><code>exports.executeSqlStoredProd = function (callback) {
      var conn = new sqlDb.Connection(settings.dbConfig)
      conn.connect().then(function () { 
          var req = new sqlDb.Request(conn);
          req.input('ProductEntryID', req.Int, 3299);
          req.input('LoginEntryID', req.Int, 4);
          req.input('TempLoginEntryId', req.Int, -1);
          req.input('AddToWishList', req.Bit, 0);
          req.input('WebPortalId', req.Int, 0);
          req.execute('J_ViewAProduct').then(function(err, recordsets) {
          console.log(recordsets);
          callback(recordsets)
      })}).catch(function(err){ 
          console.log(err);
          callback(null, err);
      });
  }
  </code></pre>
  
  <p>I did the request sucessfully using the package "Seriate" but would prefer to use mssql. The code that worked for "Seriate" is below.</p>
  
  <pre><code>exports.getVAP = function(req, resp, pid) {  
      sql.execute({
          procedure: "J_ViewAProduct",
          params: {
              ProductEntryID: {
                  type: sql.INT,
                  val: pid
              },
              LoginEntryID: {
                  type: sql.Int,
                  val: 4
              },
              TempLoginEntryId: {
                  type: sql.Int,
                  val: -1
              },
              AddToWishList: {
                  type: sql.Bit,
                  val: 0
              },
              WebPortalId: {
                  type: sql.Int,
                  val: 0
              }
          }
      }).then(function(results){
          console.log(results)
          httpMsgs.sendJSON(req, resp, results)
          //httpMsgs.sendJSON(req, resp, results[0])
          resp.end();
      }), function(err){
          httpMsgs.show500(req, resp, err)
      }
  
  };
  </code></pre>