Open Gong-Allen opened 5 months ago
i would not use this, simply use a connection string
const mssql= require('mssql/msnodesqlv8')
const {runQuery} = require("./query");
const connectionString = "Driver={ODBC Driver 17 for SQL Server};Server=(localdb)\\node;Database=scratch;Trusted_Connection=yes;"
async function runner() {
const res = await runQuery(mssql, connectionString, 'select top 3 * from syscolumns')
console.log(JSON.stringify(res, null, 4))
}
runner().then(() => {
console.log('done')
})
query.js
async function runQuery(mssql, connectionString, sqlString) {
const config = {
connectionString: connectionString
}
const pool = await mssql.connect(config)
const res = await pool.query(sqlString)
await pool.close()
return res
}
exports.runQuery = runQuery
Hi @TimelordUK , Thanks for your response, but I am not asking how to use Windows Authentication, I am asking the protocol of this Windows Authentication, is it Kerberos?
After reading some documentation I know I can use below configuration to enable Windows Authentication
So what is the authentication protocol for this Windows Authentication? Thanks.