Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Order by fails #4

Open
kbrekke opened this Issue · 4 comments

3 participants

@kbrekke

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)

@cretz
Owner

I'm an idiot, I didn't implement this token yet: http://msdn.microsoft.com/en-us/library/dd303317%28v=PROT.13%29.aspx. I will get to it shortly.

@cretz cretz was assigned
@cretz cretz closed this in 8fcaf35
@cretz cretz reopened this
@cretz
Owner

(reopening so that it will become obvious when this is released on npm)

@ekryski

Hey man. Do you wanna push this to npm? I have the same issue and if you have actually fixed it that would be suweet! Thanks for the effort by the way. It's really appreciated.

@cretz
Owner

I need to fix a couple more basic issues before I publish, sorry. But the code can be checked out and used easily as is from master. I commit the compiled JS.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.