title: Node Express Multiple SQL server Connection
body: <p>I need to connect to diferent databases on direfent servers.
  The servers are Microsoft SQL Server.</p>
  
  <p>I do it like this:</p>
  
  <blockquote>
    <p>dbconfig.js</p>
  </blockquote>
  
  <pre><code>    var sql1 = require('mssql')
      var sql2 = require('mssql')
  
      var conn1 = {server:"SERVER IP", database:"db1", user:"foo", password:"foo", port:1433}
  
      var conn2= {server:"SERVER2 IP", database:"db2", user:"foo2", password:"foo2", port:1433}
  
  var server1= sql1.connect(conn1)
      .then(function() {  debug('Connected'); })
      .catch(function(err) { debug('Error connect SQL Server', err);  });
  
      var server2= sql2.connect(conn2)
          .then(function() {  debug('Connected'); })
          .catch(function(err) { debug('Error connect SQL Server', err);  });
  
  module.exports = {"ServerConn1": sql1, "ServerConn2": sql2};
  </code></pre>
  
  <p>After that, both connection are active, but when I do a query to the first connection it didn't work.</p>
  
  <blockquote>
    <p>The error is Invalid object name 'FooDatabase.dbo.fooTable'.</p>
  </blockquote>
  
  <p>Can anyone help me to solve this issue?</p>
  
  <p>Thanks!</p>