'How to use node-mssql bulk together with a stored procedure?
We use node-mssql and we're trying to send an array of data to a stored procedure.
Unlikely the TVP which seems a little bit complex, we found this bulk method which is very interesting, but all the examples that we found create a new table instead of pushing data to a stored procedure.
Is there a way to use it to get the bulk results in a stored procedure?
Our SQL Server version is 2012. Really appreciate any help in advance.
Solution 1:[1]
If table valued parameters, seems very complex to pass from node.js, alternatively, you can have a staging table and bulk load data into the staging table and you can process the bulkload table inside the stored procedure.
Follow below steps:
- BULK LOAD INTO Staging Table
- Process the staging table inside the stored procedure
- Clean up the Staging table inside the stored procedure, once you are done with the processing.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Venkataraman R |
