Database Configuration to connect with named instance SQL Server with mssql for node.js

After some frustration, it found that Node JS mssql (5.0.5) doesn't like instance name in config file to make mssql.ConnectionPool(config)-

Works


    dbConfig: {
        "user": "user",
        "password": "pass",
        "server": "myserver",  //  Without instance name 
        "database": "dbname",
        "port":1433,
        "driver": "tedious",
        "options": {
            "instance":"mylocaldevdatabase",
            "trustedConnection": true
          }
        }


Doesn't Work




    dbConfig: {
        "user": "user",
        "password": "pass",
        "server": "myserver\\myinstance",  //  With instance name 
        "database": "dbname",
        "port":1433,
        "driver": "tedious",
        "options": {
            "trustedConnection": true
          }
        }


while making connection as in Node Js 

import * as mssql from "mssql";

mssql.ConnectionPool(dbConfig)

Comments

Popular posts from this blog

Update WPF Interaction Triggers in from .Net Framework 4.8 to .Net 5

Instruct GIT not to track a specific file

[Code Snippet] Assert Exception in private methods using PrivateObject