I had the same problem. Solved using rowCollectionOnDone: true
option and doneInProc
event on Request object like below. I don't know why callback function return empty array, when it should.
var config = {
userName: '...',
password: '...',
server: 'localhost',
options: {
port: 2005,
database: 'db1',
rowCollectionOnDone: true
}
}
connection.execSql(new Request('SELECT * FROM Products', function(err, rowCount, rows){
if(err) {
throw err;
}
})
.on('doneInProc',function(rowCount, more, rows){
console.log(rows); // not empty
})
);