{"action":"created","issue":{"url":"https://api.github.com/repos/patriksimek/node-mssql/issues/155","labels_url":"https://api.github.com/repos/patriksimek/node-mssql/issues/155/labels{/name}","comments_url":"https://api.github.com/repos/patriksimek/node-mssql/issues/155/comments","events_url":"https://api.github.com/repos/patriksimek/node-mssql/issues/155/events","html_url":"https://github.com/patriksimek/node-mssql/issues/155","id":70694294,"number":155,"title":"Trouble connecting to SQL server (SQL instance name missing)","user":{"login":"aruss","id":1374135,"avatar_url":"https://avatars.githubusercontent.com/u/1374135?v=3","gravatar_id":"","url":"https://api.github.com/users/aruss","html_url":"https://github.com/aruss","followers_url":"https://api.github.com/users/aruss/followers","following_url":"https://api.github.com/users/aruss/following{/other_user}","gists_url":"https://api.github.com/users/aruss/gists{/gist_id}","starred_url":"https://api.github.com/users/aruss/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aruss/subscriptions","organizations_url":"https://api.github.com/users/aruss/orgs","repos_url":"https://api.github.com/users/aruss/repos","events_url":"https://api.github.com/users/aruss/events{/privacy}","received_events_url":"https://api.github.com/users/aruss/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-04-24T13:42:30Z","updated_at":"2015-04-27T12:54:03Z","closed_at":null,"body":"Hi I am having troubles connecting to SQL server\r\n\r\nMy MSSQL version is 12.0.2000.8 (SQL Server 2014, local instance not azure)\r\n\r\nMy code is mostly just from examples\r\n\r\n\tvar sql = require('mssql');\r\n\r\n\tvar config = {\r\n\t\tuser: 'devuser',\r\n\t\tpassword: 'devuser',\r\n\t\tserver: 'GRIFF\\\\SQLEXPRESS',\r\n\t\tdatabase: 'devdb',\r\n\t\tport: 1433,\r\n\t\tdebug: true,\r\n\t\toptions: {\r\n\t\t\tencrypt: false // Use this if you're on Windows Azure\r\n\t\t}\r\n\t}\r\n\r\n\tvar connection = sql.connect(config, function(err) {\r\n\r\n\t\tconsole.log(err);\r\n\r\n\t\tvar tpl = 'insert into Users (DisplayName, Email) values (\"@displayName\", \"@email\")';\r\n\t\tvar ps = new sql.PreparedStatement(connection);\r\n\t\tps.input('displayName', sql.NVarChar(255));\r\n\t\tps.input('email', sql.NVarChar(255));\r\n\t\tps.prepare(tpl, function(err) {\r\n\r\n\t\t\tconsole.log(err);\r\n\r\n\t\t\tvar user = {\r\n\t\t\t\tdisplayName: 'Jim',\r\n\t\t\t\temail: 'jim@panse.de'\r\n\t\t\t};\r\n\r\n\t\t\tps.execute(user, function(err, recordset) {\r\n\r\n\t\t\t\tconsole.log(err);\r\n\t\t\t\tconsole.log(recordset);\r\n\r\n\t\t\t\tps.unprepare(function(err) {\r\n\r\n\t\t\t\t\tconsole.log(err);\r\n\t\t\t\t});\r\n\t\t\t});\r\n\t\t});\r\n\t});\r\n\r\nI get following response \r\n\r\n    { [ConnectionError: Failed to connect to GRIFF:undefined in 15000ms]\r\n      name: 'ConnectionError',\r\n      message: 'Failed to connect to GRIFF:undefined in 15000ms',\r\n      code: 'ETIMEOUT' }\r\n\r\n    C:\\Temp\\mssqlfoo\\node_modules\\mssql\\lib\\main.js:583\r\n            this.connection.pool.acquire(done);\r\n                                 ^\r\n    TypeError: Cannot call method 'acquire' of null\r\n        at PreparedStatement._prepare (C:\\Temp\\mssqlfoo\\node_modules\\mssql\\lib\\main.js:583:30)\r\n        at PreparedStatement.prepare (C:\\Temp\\mssqlfoo\\node_modules\\mssql\\lib\\main.js:513:21)\r\n        at C:\\Temp\\mssqlfoo\\sql.js:22:5\r\n        at C:\\Temp\\mssqlfoo\\node_modules\\mssql\\lib\\main.js:268:20\r\n        at C:\\Temp\\mssqlfoo\\node_modules\\mssql\\lib\\tedious.js:394:20\r\n        at C:\\Temp\\mssqlfoo\\node_modules\\mssql\\node_modules\\generic-pool\\lib\\generic-pool.js:274:11\r\n        at Connection.<anonymous> (C:\\Temp\\mssqlfoo\\node_modules\\mssql\\lib\\tedious.js:347:26)\r\n        at Connection.g (events.js:180:16)\r\n        at Connection.emit (events.js:95:17)\r\n        at Connection.connectTimeout (C:\\Temp\\mssqlfoo\\node_modules\\mssql\\node_modules\\tedious\\lib\\connection.js:709:10)\r\n\r\nContent of `mssql_debug_1429881975435.log`\r\n    \r\n    Failed to connect to GRIFF:undefined in 15000ms\r\n\r\nThat `GRIFF:undefined` thing looks pretty wrong, the SQL instance name is missing. Do I do something wrong here? "},"comment":{"url":"https://api.github.com/repos/patriksimek/node-mssql/issues/comments/96639346","html_url":"https://github.com/patriksimek/node-mssql/issues/155#issuecomment-96639346","issue_url":"https://api.github.com/repos/patriksimek/node-mssql/issues/155","id":96639346,"user":{"login":"aruss","id":1374135,"avatar_url":"https://avatars.githubusercontent.com/u/1374135?v=3","gravatar_id":"","url":"https://api.github.com/users/aruss","html_url":"https://github.com/aruss","followers_url":"https://api.github.com/users/aruss/followers","following_url":"https://api.github.com/users/aruss/following{/other_user}","gists_url":"https://api.github.com/users/aruss/gists{/gist_id}","starred_url":"https://api.github.com/users/aruss/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aruss/subscriptions","organizations_url":"https://api.github.com/users/aruss/orgs","repos_url":"https://api.github.com/users/aruss/repos","events_url":"https://api.github.com/users/aruss/events{/privacy}","received_events_url":"https://api.github.com/users/aruss/received_events","type":"User","site_admin":false},"created_at":"2015-04-27T12:54:03Z","updated_at":"2015-04-27T12:54:03Z","body":"I tried that too, and also putting IP address in there and putting port number in the options section it all causes the same problem. According to the error message it ignores the instance name and uses undefined value for port number. "}}