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
2
votes
1 answer

NodeJS, Express, MSSQL - How do I wait for MSSQL pool to connect and return query result before printing to console

Node Version - 16.1.0 Microsoft SQL Server 2008 - 10.50.2550.0 SQL Server Management Studio - 15.0.18358.0 Windows 10 Pro Edition - 2004 OS Build ^ - 19041.572 Project Architecture: root |-…
Mr. Dr. Doom
  • 71
  • 1
  • 9
2
votes
2 answers

Line number error does not show up when using MSSQL Node?

I have been using MySQL database with Nodejs for a while. I recently switched to MSSQL with Nodejs When using a try catch block with Nodejs and Mysql any error with the query execution would give me the line at which the error occured So while using…
goxarad784
  • 395
  • 6
  • 17
2
votes
0 answers

SQL Server allowing incorrect domain name to be given for NTLM auth

Summary Using the nodejs tedious driver, I am able to specify any domain name to connect to my instance of SQL Server via NTLM authentication, and am then capable of querying the database with this connection. Background The tedious driver is used…
2
votes
0 answers

How to fix 'Could not Connect (sequence)' using Node mssql with many requests

I have created a data fetching Node.js application that goes and grabs data from our vendor information servers (different types of data), and ultimately ends up as an array of objects. This app will retrieve data on a schedule and save it to a SQL…
2
votes
1 answer

Transaction for prepared statements using Node mssql

I want to create an Express REST API and will use MSSQL for the database part. I use the mssql module and use the PreparedStatement class. Sometimes my queries have to be transactional, so I have to work with the Transaction class too. I found some…
user9945420
2
votes
1 answer

Add Identity column with npm mssql

Hi I'm using the node package mssql, I'm adding a new table like this: var companyTable = new sql.Table("companies2"); companyTable.create = true; companyTable.columns.add('id', sql.Int); companyTable.columns.add('company_name',…
2
votes
0 answers

TypeError: createSecureContext is not a function

Trying to use mssql with React. If I write a normal js file with the var sql = require("mssql"); const pool = new sql.ConnectionPool({ user: "sa", password: "password", server: "localhost", // You can use 'localhost\\instance' to connect to…
Dhaval Jardosh
  • 7,151
  • 5
  • 27
  • 69
2
votes
1 answer

Insert multiple entries to SQL Server with Node.js

I am rewriting an old API for which I am trying to insert multiple values at once into a MSSQL-Server (2008) database using the node module mssql. Now, I am capable of doing this somehow, but I want to this following best practices. I've done my…
2
votes
1 answer

Node-mssql Hangs After Query

I am having an issue where I am running a node script to retrieve data from SQL Server. It seems I am getting results, but no code is executed after the query is run. Here is what I have so far for code: var config = { user: 'blah', …
Wade73
  • 4,359
  • 3
  • 30
  • 46
2
votes
0 answers

nodejs async/await isn't waiting

I have a code block that where there are two await statements. The very first time the server is running I believe it is blowing right by the await SQL.connect. After there's been a couple of calls (allowing for time for connection) through this…
jeff
  • 3,269
  • 3
  • 28
  • 45
2
votes
0 answers

Cannot read property 'release' of null [node-mssql]

I'm trying to run a script where I pull records from one database and then insert the records into another database, but during the insertion step I keep running into this error 8 or 9 repetitions in. I'm not super familiar with the node-mssql…
Emily
  • 29
  • 3
2
votes
0 answers

Using node mssql how do I create a database?

I tried the execute method: const sql = require('../node_modules/mssql'); var dbname = 'AddressBook'; sql.connect('mssql://sa:1234@localhost/').then(pool => { return pool.request().input('db_name', sql.TYPES.Text, dbname).query`select…
MotKohn
  • 3,485
  • 1
  • 24
  • 41
2
votes
3 answers

Separating multiple SQL Server statements running in batch

I'm trying to send a batch of CREATE TRIGGER statements as a string to be processed when migrating my DB CREATE TRIGGER [dbo].[triggerBar] ON [dbo].[tableBar] INSTEAD OF UPDATE,INSERT AS BEGIN SET NOCOUNT ON -- Trigger body here.. END; CREATE…
nicholaswmin
  • 21,686
  • 15
  • 91
  • 167
2
votes
2 answers

seriate node js how close connection

I have written a query to select rows in table using seriate, now the query is able to fetch the results but the command is not exiting unless I do ctrl + c in the git bash window. Is there anyway to close the connection and come out of the session…
rahoolm
  • 733
  • 2
  • 12
  • 22
2
votes
3 answers

NodeJS connecting to sql server using node-mssql does not work

I use a named instance of SQL Server Express 2012 If I try to connect to it using SSMS it works, using these parameters: Server name: mit-007\SQLEXPRESS2012 Authentication: SQL Server Authentication Login: sa Password: mit Using…
d.a.vorm
  • 460
  • 1
  • 5
  • 15
1 2
3
13 14