mssql Npm Module returning `null` for a particular column

时间:2017-07-10 15:24:51

标签: sql-server stored-procedures npm

I am using mssql module from NPM to query some store procedures from MSSql Server. Everything works fine apart from one specific case. This particular piece of code returns null for EmailText column. I tried to execute same procedure from other places and there it returns proper value for it. I want to understand is there any limitation on the mssql module where in such case it returns null? Can I do something from node javascript code side to solve it?

sql.close()
sql.connect(sqlConfig).then(pool => {
pool.request()
  .execute('someStoredProcedure').then(result => {
    console.log(result) // Email text is null in this object as well.
    result.recordsets.forEach(record => {
      record.forEach(recordChild => {
        console.log(recordChild)
        console.log(recordChild.user_name)
        console.log(recordChild.DeviceToken)
        console.log(recordChild.EmailSubject)
        console.log(recordChild.EmailText) // returning null
        console.log(recordChild.MobileNotification)
      })
    })
  })
})

0 个答案:

没有答案