Questions tagged [node-mssql]

node-mssql MSSQL database connector for Node.js.

https://tediousjs.github.io/node-mssql/

An easy-to-use MSSQL database connector for Node.js.

There are some TDS modules which offer functionality to communicate with MSSQL databases but none of them does offer enough comfort - implementation takes a lot of lines of code. This module make work as easy as it could without losing any important functionality. node-mssql uses other TDS modules as drivers and offer easy to use unified interface. It also add extra features and bug fixes.

202 questions
4
votes
1 answer

How to (properly) chain multiple sequential MSSQL queries in Node

I'm writing a simple nodejs CLI tool while learning promises (to avoid callback hell), and every tutorial/stackoverflow example I've found only shows how to make a single call. My use case is as follows: 1. Connect to the Database (this I can do) 2.…
4
votes
3 answers

Request Error: No connection is specified for that request; while connecting to Sql server using express.js?

I am using the latest versions of node, express and mssql module. I am trying to connect to the local instance of sql server 2014 using express.js. I am using mssql module and callbacks mechanism from the official documentation. I have tried: const…
CodingManiac
  • 123
  • 1
  • 1
  • 9
4
votes
2 answers

Connect Cordova hybrid app to Azure SQL Database

I am using apache cordova and ionic framework in Visual studio 2015 to create a hybrid app. I would like to connect my app to a cloud sql database such as azure sql or google cloud sql. I need to be able to do inserts, updates, and selects. From…
4
votes
1 answer

Errors with node-mssql in a webpack-bundled React app

My React app fails to build whenever I try to use the node-mssql library. It's important that I do this on the client side, since I have to serve this app from an old IIS server. It seems that executing in Webpack browser bundle requires additional…
Scott
  • 4,211
  • 3
  • 17
  • 20
4
votes
1 answer

How does node-mssql handle connection pooling?

I'm using the node-mssql package to create an API endpoint in Node. I am wondering how the package handles connection pooling, as there isn't much explained about it on the package website. I have the following in my configuration, to allow the pool…
Clarkey
  • 698
  • 3
  • 11
  • 28
4
votes
3 answers

Node JS and SQL Server 2008 R2 Express

I want to use NodeJS to connect to a SQL Server 2008 R2 Express database. I've looked around at what NPM has to offer. Have tried mssql, mssql-simple and node-SQLServer. Some of them can be installed some do not. And those who do, will not access…
Krister Johansson
  • 691
  • 2
  • 10
  • 34
3
votes
2 answers

Why does async/await version of my transactional mssql app fail but callbacks version works?

To illuminate the problem I'm having getting a nodejs/mssql application working, I've attempted to code two functionally equivalent versions of a simple (prepared) INSERT statement wrapped in a transaction. The callbacks version works - inserts a…
CSeelig
  • 31
  • 1
  • 5
3
votes
0 answers

Handling database interruption error in node-mssql

I am using node-mssql module for connecting to SQL server. It all works nicely. I have a problem that happens quite randomly and not sure why. So, I did a bit of testing. I create a connection pool with var connection = new sql.Connection({ /*…
Gautam Kumar Samal
  • 758
  • 1
  • 7
  • 23
3
votes
0 answers

SQL Server - Performance issue with concurrent queries

I am recently facing a troubling issue with SQL Server. I am using a node program to connect and run queries. As number of request/db queries increase, it seems SQL Server performance is degrading. I used a basic test scenario, where I get around 6…
Gautam Kumar Samal
  • 758
  • 1
  • 7
  • 23
3
votes
3 answers

Tedious SQL Server TVP : parameter.value.getTime is not a function for datetime

I am trying to use TVP with tedious and keep getting this error while using a DateTime parameter. The exception while building the request is : days = Math.floor((parameter.value.getTime() - UTC_EPOCH_DATE.getTime()) / (1000 * 60 * 60 * 24)); …
Rajat banerjee
  • 1,781
  • 3
  • 17
  • 35
3
votes
1 answer

How to insert binary data into sql server using node-mssql

I'm downloading an image using node/request module, and I'm trying to figure out how to insert that image into a varbinary field in sql server using the node/mssql module. So far I have tried putting a cast into the insert statement, converting the…
Danny Ackerman
  • 997
  • 1
  • 10
  • 25
3
votes
1 answer

How does one call a SQL Server scalar function using the mssql package for nodejs?

I have a custom scalar function in SQL Server 2012. It takes 2 floats and returns a nvarchar. Tested and works inside SQL Server. I've not found any examples of how to call it from node-mssql. The attempts I've made fail with: TypeError: Cannot set…
Dude 2.5
  • 128
  • 3
  • 8
3
votes
1 answer

Node.js npm mssql function returning undefined

I am using mssql with node.js to connect to an sql server db. I am trying to reduce code by wrapping the connection code in a function with one query parameter. When I call the function from with in a router.get function, it returns undefined. Any…
user1781272
  • 862
  • 2
  • 14
  • 25
3
votes
0 answers

is there a way of using node.js mssql package with a Trusted_Connection user?

I have been trying to connected to sql server 2008 for the past few days using trusted user connection. I have had complete success with the username/password connection string. However, when I try to connect as a trusted user, I completely fail.…
user1781272
  • 862
  • 2
  • 14
  • 25
2
votes
0 answers

node mssql multiple queries in one BEGIN TRANSACTION

Would like to do multiple updates via my API using mssql transactions. Example: Shipping Table Listing Table User_Notes Table Customer_Login Table Push_Notification Table Which is the right way of doing it? I was thinking at first of doing it with…
Dhaval Jardosh
  • 7,151
  • 5
  • 27
  • 69
1
2
3
13 14