Nodejs Mssql - Too Many Parameters Passed Stored Procedure
I running into 'Too many parameters passed' to stored procedure while trying to run a stored procedure in NodeJs using mssql. Code: //This computerName is what we'll find in our ms
Solution 1:
If you specify the OUTPUT keyword for a parameter in the procedure definition than only you get the privilege to use the below line; when you are defining sql.Request()
.output('sqlOutput', sql.VarChar(1000), "Stored procedure has not run yet!!")
Using OUTPUT type in stored procedure just for an example considering your case:
CREATEPROCEDURE dbo.getSysStatus_ByName
@ComputerNamevarchar(100),
@sqlOutputVarChar(1000) OUTPUT
ASBEGIN//YOUR SP CODE HERE
ENDIf your stored procedure doesn't have the OUTPUT parameter and it simply returns the recordsets you can fetch the same via function callback :
.execute('dbo.getSysStatus_ByName').then(function(recordsets) {
//recordsets is an result return by your executed stored procedure })SQL Server with NODE.JS - Get started
As in your case your stored procdeure doesn't contain any Output type so you can simply remove /comment out below line :
.output('sqlOutput', sql.VarChar(1000), "Stored procedure has not run yet!!")
Post a Comment for "Nodejs Mssql - Too Many Parameters Passed Stored Procedure"