tediousjs / node-mssql

Microsoft SQL Server client for Node.js
https://tediousjs.github.io/node-mssql
MIT License
2.24k stars 471 forks source link

How to use the user-defined data types? #1610

Open jhunexjun opened 9 months ago

jhunexjun commented 9 months ago

Can this package supports user-defined data types?

Expected behaviour:

just normal as built-in types like NVARCHAR, VARCHAR, etc.

Actual behaviour:

TypeError: Cannot read properties of undefined (reading 'type')

Configuration:

return await msSqlConnect.getInstance().then(pool => {
        return pool.request()
          .input('userId', msSql.T_USR_ID, req.query.userId)
          .query('select * from SY_USR where USR_ID = @userId')
      }).then(result => {
        console.log('result: ', result);
        return result.recordset;
      }).catch(err => {
        console.log(err);
      });

The T_USR_ID is a user-defined data type.

Software versions