error when connecting to MSSQL 2008 without instance

0

I have 2 connections with node using the package mssql

var config = {

    user: 'xx',
    password: 'xx',
    server: 'DESARROLLO\PROGRAMACION',
    database: 'prueba',
    options: {
       encrypt: true
     }

} 

This works because it has an instance and I have another one:

var config = {

    user: 'xx',
    password: 'xx',
    server: 'DESARROLLO', 
    database: 'pruebabase2',
    options: {
       encrypt: true
     }
} 

This has no instance and is a motor sql 2008 like the other but the one that has no instance does not connect.

The 2 connections use this:

sql.connect(config, function(err) {

    var request = new sql.Request();
    request.query('select 1 as number', function(err, recordset) {
        // ... error checks 
        console.log(err); 
        console.dir(recordset);
    });
});

With the first connection goes well but with the second connection goes wrong the 2 servers have the same operating system and the same engines

Does anyone know that I must configure on the server so that the one that has no instance connect? since it returns the following error:

I'm sure there must be some configuration on the server that does not handle instance

  

{ConnectionError: Connection is closed.       at ConnectionError (D: \ Projects \ Mssql \ node_modules \ mssql \ lib \ base.js: 1428: 7)       at Request._query (D: \ Projects \ Mssql \ node_modules \ mssql \ lib \ base.js: 1300: 37)       at Request._query (D: \ Projects \ Mssql \ node_modules \ mssql \ lib \ tedious.js: 497: 11)       at Request.query (D: \ Projects \ Mssql \ node_modules \ mssql \ lib \ base.js: 1243: 12)       at D: \ Projects \ Mssql \ app.js: 62: 13       at _poolCreate.then.catch.err (D: \ Projects \ Mssql \ node_modules \ mssql \ lib \ base.js: 270: 7) code:   'ECONNCLOSED', name: 'ConnectionError'}

    
asked by John E Castiblanco 13.07.2017 в 22:49
source

1 answer

1

Run the following in your SQL 2008 and use the result as the value for the key 'server' in config:

SELECT @@SERVERNAME + '\' + @@SERVICENAME AS nombreInstancia
    
answered by 13.07.2017 / 22:52
source