I have a large number of T-SQL statements logged from a server I manage. I’m trying to boil them down to one instance of each. Here’s one of them: I want to convert that to a JavaScript RegExp, substituting runs of digits for d and stuff between apostrophes into ‘.*’. So far I’ve got this far with Deno: This renders
Tag: sql-server
Get function reference from mssql TYPES object using string
Node.js / mssql / typescript I’m trying to build a set of input parameters dynamically and add them to a prepared statement. With the code below, the error I get is: Element implicitly has an ‘any’ type because expression of type ‘string’ can’t be used to index type ‘{ VarChar: ISqlTypeFactoryWithLength; NVarChar: ISqlTypeFactoryWithLength; Text: ISqlTypeFactoryWithNoParams; … 29 more …; Variant:
How do I parse part of a JSON object that has mixed string and numbers?
I have a JSON file that was processor generated with lines like this I can target the ‘jsonData’ object but that returns everything within the double quotes as a string. I tried …dataset[0].jsonData[8] which returns the ‘3’ from the first value. I guess I could throw the mixed strings into a JS function and use regex to remove the extra
Cypress task undefined even though the promise is returned
I used TypeScript and Cypress framework for the automation purpose. To retrieve the data from SQL Server I have tried with Cypress sql server but that is available only in JavaScript, due to that I have used the JavaScript MSSQL library to retrieve the values under plugin/index.js then called that function in the required TypeScript file. But it throws the
How to Insert bulk Array of data in mssql table using nodejs
I am using node-mssql, LInk : https://www.npmjs.com/package/mssql i want to insert bulk array of data in mssql database i am getting array of array records eg: [[row1],[row2],[row3]] i want to insert these records in mssql database Error : The label ‘@’ has already been declared. Label names must be unique within a query batch or stored procedure. Answer Use bulk
OData $top and PageSize has no impact on web API performance
I currently have a web API for an ASP.net WebApplication that queries a view of all of our Test Data (About 500k rows) in SQL server 2008 R2 which is referenced in the Web API via Entity Framework Filtering Data has acceptable performance, here is the client side code I am using to debug the Web API: This Query: “../api/TestData?$filter=DeviceTypeID
node-mssql Transaction insert – Returning the inserted id..?
I’m using node-mssql 3.2.0 and I need to INSERT INTO a table and return the id of the inserted record. I can successfully use sql.Transaction() to insert data, but the only parameters given to callbacks (request.query() and transaction.commit()) are: So recordset is undefined for INSERT, UPDATE and DELETE statements, and affected is the number of rows affected, in my case
Javascript date to sql date object
I’m trying to write a query that takes a Javascript date object and then puts it in an object type that is recognized by both SQL Server and Oracle database types. The issue is that I’m using webservices. So it has to be a string, not an actual passed parameter. Here’s what I mean: Except firstDayOfMonth and lastDayOfMonth are surrounded