1

I am using npm mssql and I need to pass an SQLDbType.Structured parameter, is there a mapping for this type?

Update:

NodeJS connecting to SQL Server 2008 or later.

Dalorzo
  • 19,834
  • 7
  • 55
  • 102

1 Answers1

1

Table value parameters was added both to tedious and mssql recently.

Here is the documentation on how to do it from node-mssql (added to version ^0.5.1):

var tvp = new sql.Table()

// Columns must correspond with type we have created in database.
tvp.columns.add('a', sql.VarChar(50));
tvp.columns.add('b', sql.Int);

// Add rows
tvp.rows.add('hello tvp', 777); // Values are in same order as columns.
Dalorzo
  • 19,834
  • 7
  • 55
  • 102