1

我需要使用 SQL Server 2008 获取列的描述,Tedius.js但是当我运行查询时会抛出下一条消息:

events.js:182
      throw er; // Unhandled 'error' event
Error: Unknown type: 0

这是代码:

function executeStatement() {
    var query = `select  sc.name as colum, sep.value as description  from sys.tables st
inner join sys.columns sc on st.object_id = sc.object_id
left join sys.extended_properties sep on st.object_id = sep.major_id`

    request = new Request(query, function(err, rowCount) {
        if (err) {
            console.log(err);
        } else {
            console.log(rowCount + ' rows');
        }
    });

    request.on('row', function(columns) {
        columns.forEach(function(column) {
            console.log(column);

        });
    });


    connection.execSql(request);
}
4

0 回答 0