This code example from documentation throws error: RequestError: Table was not found on the server.
With tedious it`s OK.
'use strict'
const mssql = require('mssql/msnodesqlv8')
const connectString = `Driver={SQL Server Native Client 11.0};Server=sqlserver;Trusted_Connection=yes;`
mssql.connect(connectString)
.then(() => {
const table = new mssql.Table('#table_name')
table.create = true
table.columns.add('a', mssql.Int, {primary: true})
table.columns.add('b', mssql.VarChar(50), {nullable: false})
table.rows.add(777, 'test')
const request = new mssql.Request()
return request.bulk(table)
})
.then(console.log)
.catch((err) => {
console.error(err)
})
"msnodesqlv8": "^0.4.9",
"mssql": "^4.1.0",
I encountered this error as well with the same versions of msnodesqlv8 and mssql.
this should work OK now.
Most helpful comment
this should work OK now.