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.

1 Answer 1

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.
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.