--

This syntax (article) is a bit outdated. Should be using async/await or leveraging promise based techniques.

However, the only thing I see wrong in this code is that res contains the data and you are missing some parens and braces.

sqlRequest.query(sqlQuery, (err, res)=>{

if (err){

console.log(err)

}else{

console.log(res.recordset[0])

}

})

--

--

gravity well (Rob Tomlin)
gravity well (Rob Tomlin)

Written by gravity well (Rob Tomlin)

Software Engineering Manager. Explorer, learner, teacher, and more

No responses yet