cretz/node-tds — Issue #14: SQL 2008 connection problem
Author: tjanczuk
Created: 2012-03-02 00:41:59+00:00
State: open

I tried connecting to SQL 2008 without success. Is this supported?

The instance is a SQL Azure instance that supports TDS v7.3 A or B. This is my code:

```
var tds = require('tds')

var conn = new tds.Connection({
host: 'bsx92c1i9t.database.windows.net',
port: 1433,
database: 'arr',
userName: 'arr',
password: // cut out
tdsVersion: 0x730A0003, // SQL Azure only supports TDS v7.3 A and B
logDebug: true,
logError: true
})

conn.on('error', function(error) {
console.error('Received error', error);
});
conn.on('message', function(message) {
console.info('Received info', message);
});

conn.connect(function (error) {
console.log('connected: ': error)
})
```

And this is the output I see:

```
Connecting to SQL Server with config {"host":"bsx92c1i9t.database.windows.net","port":1433,"database":"arr","userName":"tjanczuk","password":"","tdsVersion":50334323,"logDebug":true,"logError":true}
Connection established, pre-login commencing
Sending packet: PRELOGIN at state 1
Inserting header for type: 18
Packet size: 41
Received 37 bytes at state 1
Retrieved header: { type: 4,
status: 1,
length: 37,
processId: 0,
packetId: 1,
window: 0 }
Found non token stream packet
Added pending value type: 0, offset: 21, length: 6
Added pending value type: 1, offset: 27, length: 1
Added pending value type: 2, offset: 28, length: 1
Added pending value type: 3, offset: 29, length: 0
Version: [ 11, 0, 4, 223, 0, 2 ]
Encryption: 3
Reading instance name of length: 1
Instance name:
Ignoring thread ID:
Buffer remaining:
Logging in with config {"host":"bsx92c1i9t.database.windows.net","port":1433,"database":"arr","userName":"tjanczuk","password":"","tdsVersion":50334323,"logDebug":true,"logError":true}
Sending packet: LOGIN7 at state 3
Inserting header for type: 16
Packet size: 244
Socket closed
```