Skip to content

Conversation

@alexsch01
Copy link

@alexsch01 alexsch01 commented Nov 18, 2025

Being able to override CONNECTION_DRIVER (now DEFAULT_CONNECTION_DRIVER) variable for mssql/msnodesqlv8

const sql = require('mssql/msnodesqlv8');

const config = {
  server: "MyServer",
  database: "MyDatabase",
  options: {
    trustedConnection: true, // Set to true if using Windows Authentication
    trustServerCertificate: true, // Set to true if using self-signed certificates
  },
  driver: "msnodesqlv8", // Required if using Windows Authentication
  msnodesqlv8_Driver: "ODBC Driver 18 for SQL Server",
};

(async () => {
  try {
    await sql.connect(config);
    const result = await sql.query`select TOP 10 * from MyTable`;
    console.dir(result);
  } catch (err) {
    console.error(err);
  }
})();

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant