cretz/node-tds — Issue #4: Order by fails
Author: kbrekke
Created: 2012-01-11 15:58:52+00:00
State: open

Hi,

Good work on this module. I'm at MS SQL Server 2005 and node.js 0.6.7. I'm experiencing trouble when attempting to do an ORDER BY;

var stmt = conn.createStatement('SELECT TOP 1 * FROM MyDb.dbo.MyTable t ORDER BY t.MyTableId');

This query works in SQL Managmenet Studio. It works without the ORDER BY clause.
I get the following error;

/dev/odbctest/node_modules/tds/lib/tds-client.js:210
throw err;
^
Error: Unrecognized type: 169
at TokenStreamPacket._getTokenFromType (/dev/odbctest/node_modules/tds/lib/tokenstream.packet.js:63:15)
at TokenStreamPacket.nextToken (/dev/odbctest/node_modules/tds/lib/tokenstream.packet.js:71:18)
at TdsClient._handleToken (/dev/odbctest/node_modules/tds/lib/tds-client.js:197:35)
at TdsClient._handlePacket (/dev/odbctest/node_modules/tds/lib/tds-client.js:270:19)
at TdsClient. (/dev/odbctest/node_modules/tds/lib/tds-client.js:169:19)
at Socket. (/dev/odbctest/node_modules/tds/lib/tds-client.js:2:59)
at Socket.emit (events.js:67:17)
at TCP.onread (net.js:347:14)