5

Possible Duplicate:
Connecting to a remote Microsoft SQL server from Node.js

I'm looking for an up-to-date explanation of how to connect to a MS SQL Sever 2008 using Node.js (v0.5.7)

I have tried both Node.js projects on GitHub here:

https://github.com/vivina/node-mssql

https://github.com/orenmazor/node-tds

node-tds is an abandoned project and node-mssql appears to be incomplete or at least the code-base seems to be out-of-date with the most recent version of Node.js

Has anyone actually got Node.js to connect to and query a Microsoft SQL Server 2008?

I would love to see some configuration details (versions, addons etc.) and code samples.

Thanks,

P.

Out of date answers on SO: Node.js and Microsoft SQL Server, Connecting to a remote Microsoft SQL server from Node.js

Community
  • 1
  • 1
paperclip
  • 2,280
  • 6
  • 28
  • 39

2 Answers2

5

Just today I released a new module, for windows only, allowing native and asynchronous use of MSSQL. It's called TSQLFTW, and currently supports connecting and querying the database. It returns results in JSON.

Check out the Github here: https://github.com/gfosco/tsqlftw

Hacker News submission/comments: http://news.ycombinator.com/item?id=3353389

Fosco
  • 38,138
  • 7
  • 87
  • 101
4

I am working on a solution (https://github.com/pekim/tedious), but it's not quite usable yet.

Currently it can connect, authenticate, send SQL statements. The parsing of the response to the statement is in progress; some column metadata is processed, and the rows data itself is next.

In the next few weeks (it's a spare time project), I hope to have it in a useable, but far from complete state. The API, and the guts of it, will still be subject to significant changes though, as there's lots that I'm still unhappy about. There's quite a bit of additional error checking and state handling that need to be addressed, as well as stored procedures and parameterised statements.

I'll try to update the status in the README a bit more frequently, so that's it's easier to see how close (or far) from useable it is.

pekim
  • 66
  • 3
  • tedious is now usable for simple use cases. – pekim Jan 08 '12 at 10:40
  • Can't you write a MSSQL version of http://nodejsdb.org/? That would be a better solution for the community behind nodejs. – Kolky Feb 03 '12 at 09:53
  • It's githubbed and its JavaScript. Fork it and slap a nodejsdb interface on it. @pekim thank you for this. I can't wait to spend a little time this weekend on a project that demonstrates how a JS dev looks at a web service problem. – Erik Reppen Apr 30 '13 at 20:02
  • I am currently using it. So far, so good! – Dalorzo Apr 01 '14 at 13:59
  • Today, node-mssql wrapping Tedious is the best way to go for using MSSQL and Node. http://stackoverflow.com/questions/5156806/node-js-and-microsoft-sql-server/22658512#22658512 – Christiaan Westerbeek May 13 '14 at 20:13