Questions tagged [tedious]

Node Module - Tedious it is used to interact with instances of Microsoft's SQL Server.

Tedious is an implementation of the TDS protocol, which is used to interact with instances of Microsoft's SQL Server.

It is intended to be a fairly slim implementation of the protocol, with not too much additional functionality.

282 questions
3
votes
2 answers

data set to json with group

I am working on an angular + nodejs application and I need some data from sql in json format. I am able to get the data in json but I need the data to be grouped in a tree like manner. Is there a way to do this in sql, server or in front end…
Rohit
  • 1,520
  • 2
  • 17
  • 36
3
votes
2 answers

Is there a way to specify the database when defining Tedious configuration (Node.js)?

According to the Tedious Getting Started Guide, connecting to a database is done like this: var Connection = require('tedious').Connection; var config = { userName: 'test', password: 'test', server: '192.168.1.210', …
Paul
  • 301
  • 1
  • 2
  • 12
3
votes
1 answer

How to replicate an Exact Binomial Test in R so that it runs through entire columns in a dataframe and generates an output

binom.test(4175, 6534, p = 0.5, + alternative = c("two.sided"), + conf.level = 0.95) Exact binomial test #Output data: 4175 and 6534 number of successes = 4175, number of trials = 6534, p-value < 2.2e-16 …
Alus
  • 33
  • 3
3
votes
1 answer

Is it possible to set the ROWLOCK table hint from a transaction isolation level in MSSQL?

I am writing a wrapper for an MSSQL driver and I have been told we need to ensure that every incoming UPDATE or DELETE query contains the ROWLOCK table hint. It would be fantastic if I could do this at a transaction isolation level rather than some…
Paulo Black
  • 310
  • 2
  • 10
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

Failed to connect to local SQL Server database using Tedious and Node JS

I am trying to connect to SQL Server on my local machine. I am trying to use tedious and tedious-ntlm. The configuration for both is as below: var tds = require("tedious-ntlm"); //var tds = require("tedious"); var config = { userName:…
Pratik Gaikwad
  • 1,526
  • 2
  • 21
  • 44
3
votes
3 answers

Table Valued Parameters in Node/Tedious Example

I have a function that works really well for executing stored procedures and SQL snippets. I was wondering if anyone would be able to help me make the equivalent function for Table Valued Parameters? My current function is as follows: var exec =…
Marc D
  • 61
  • 1
  • 3
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

Azure DB disconnections and connection timout

We're having "storms" of DB disconnections and connections timeouts once every couple of days. We're running Node.js on Azure WebApps and using tedious to connect SQL Azure, any ideas where to start looking for the problem?
Guy Korland
  • 9,139
  • 14
  • 59
  • 106
3
votes
6 answers

Node.js Tedious Rows is an empty array but RowCount is correct

So this is my basic chunk of code that I'm running. I've got RowCount coming back as expected (there's only 5 items right now) and but rows comes back as an empty array. Am I doing something wrong? By the way I'm connecting to SQL azure. I don't…
Max Alexander
  • 5,471
  • 6
  • 38
  • 52
2
votes
1 answer

msal-node using old jsonwebtoken npm pkg triggering npm audit issue

we are using mssql npm package it has dependency with like below: mssql > tedious > @azure/identity > @azure/msal-node > jsonwebtoken Now we are getting below audit error: https://github.com/advisories/GHSA-27h2-hvpr-p74q Any one already having…
2
votes
1 answer

How to connect to Microsoft SQL Server from Azure Functions using JavaScript?

We´re developing a function app in JavaScript with the Serverless Framework and deploying it to Azure. We´re pulling data from a Microsoft SQL Server 2014 database, everything goes well when testing the functions in a local environment with the…
Enkei
  • 25
  • 4
2
votes
2 answers

How can I insert objects in SQL Server running a function in a loop? ConnectionError: .connect can not be called on a Connection in `Connecting` state

I'm working in a NodeJS project, this project I decided to change the way I'm doing it because this way wasn't working, let me try to explain it. I need to insert data into a SQL Server DB, so I did a function insertOffice() this function opens a…
Martín JF
  • 152
  • 2
  • 14
2
votes
0 answers

How can I insert multiple data to SQL Server in a loop? using Node JS Tedious

I have a project in Node JS that takes data from an array data2, uses this data to create a object myObject using a fetch with data from an API let url = `https:... and then saves it to a DB in SQL Server, the issue that I'm having is that I…
Martín JF
  • 152
  • 2
  • 14
2
votes
0 answers

No collation was set by the server for the current connection in TediousJS

I'm using the newBulkLoad method of the Connection class of TediousJS. After trying to execute this piece of code: bulkLoad.addRow(TYPES.Null, col2, col3, col4, col5, TYPES.Null, col7, col8, col9, TYPES.Null,…
d3vcho
  • 85
  • 7
1 2
3
18 19