Automation Techs For Productivity And Fun

Connecting To Microsoft SQL Server From Node.js Using Windows Authentication

I usually use Knex.js to connect to databases from Node.js programs.

According to the official document above, Knex.js is available for connecting to MSSQL, but it failed when I tried to connect using Windows Authentication.

It seems the package "node-mssql" which Knex.js is using, has two drivers: "Tedious" and "msnodesqlv8", and the default driver Tedious does not work with Windows Authentication.

I couldn't find out how to change the driver to use from Knex.js, so I gave up using Knex.js and decided to use "msnodesqlv8" directly from my program.


Here I found a document for msnodesqlv8.

This is a simple example program to connect with MSSQL and fetch data from a table using Promise.


Search This Blog


Generate Data For Testing With PostgreSQL

When developing a software using PostgreSQL database as storage, the function "generated_series" is very useful to create data ...

Powered by Blogger.


Recent Posts