Trying to call sql server sproc from node.js using "mssql" module, when we call, it throws the error "EREQUEST", Error Details :"RequestError: Cannot insert the value NULL into column 'colName'". Don't know why but when run it on sql server it works as expected and gives the result. My Sproc containing the temp table and insert the null values in some of the columns.Please refer the following code.
var request = new sql.Request();
request.input("param1", value1);
request.input('param2', value2);
request.stream = true;
request.execute('Sp_Name', function (err, recordset) {
});
var rows = [];
request.on('row', function (row) {
rows.push(row);
console.dir(row);
});
request.on('error', function (err) {
console.log('IN error =>' + err.code + "=>" +err);
});
request.on('done', function (returnValue) {
console.log('IN Done');
});
thanks for your help..:)
1条答案
按热度按时间6tr1vspr1#
Use
CAST(NULL AS yourtype)
insteadNULL