Friday, April 12, 2019

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)

NodeJS

1 comment :

  1. The store has been solving problems for me, the service is very patient, this is a perfect purchase. A copy of the watch When I received this watch, I thought it was a good copy of the watch.Replica Breitling Watches I like this online store, this watch is simple and generous.replica Breitling navitimer Very satisfied with this purchase.

    ReplyDelete

 

© 2011 GIS and Remote Sensing Tools, Tips and more .. ToS | Privacy Policy | Sitemap

About Me