I'm stuck trying to connect my database with my React app. I created the database using SQL in SQL Server Management Studio. I attempted to use express for the connection, but it seems like there are pieces missing in my code. Can someone guide me on what ...
I'm working on setting a default value in my select box, retrieved from the database, using ng-options. Here's my view: <select class="form-control samlength modalinput" ng-options="p.procid as p.procname for p in processes track ...
Is there a way to pass the response data from one SQL Server stored procedure into another stored procedure for logging purposes? I've attempted different methods but encountered issues with connection pools and errors like HTTP Status: 500, subStatu ...
My select query is providing data in the following format: [{ id: 'CB2FD8B7-7E6D-4BF3-8E73-70D41FFBE456', products: '[{"product_id":"22061DA1-5D64-475A-B36A-140ECFE8D6B7"}]', falconpay_api_response: null, dhl_updated_by: null }, ... ] My current ...
Currently working with an SQL Server in NodeJS, and successfully pulling data. However, struggling to pass the retrieved data back to the calling function. Below is my code snippet for querying the database: const dbq = require('./dbquery.js'); ...
Is it possible to query a JSON document that contains field names with special characters like "$id"? SELECT [ID] FROM OPENJSON( '[{"$id":42},{"$id":43}]', '$' ) WITH ([ID] NVARCHAR(25) '$.$id') WHERE ID = ...
I am encountering an issue with querying data from my SQL server host on Microsoft Azure. When I attempt to query by PHP, I consistently receive a 500 error code; however, querying the same data through Visual Studio is successful. Could you please help ...
Recently, I encountered an issue with a SQL query that retrieves customer transaction headers based on their card_number. The query should return an audit_number column. Surprisingly, when executing the query in SSMS software, the results are correct; howe ...
There are 8 checkboxes in this example: <table style="border-collapse: collapse; width: 100%;" border="1"> <tbody> <tr style="height: 21px;"> <td style="width: 25%; height: 21px;"><strong>Technology</strong& ...
As a newcomer to AngularJS, I apologize if my question seems basic. I hope the title of my question is clear. I am currently using AngularJS with an ASP.Net MVC application to retrieve data from a SQL server table and display it on the view. While everyth ...
In the event that my MSSQL server experiences a crash and an app client makes a request to the API, the current behavior is for it to endlessly spin until Express times out the unanswered request. By enabling logging in TypeORM, I am able to observe the e ...
Starting a Rest API project using NodeJS with Restify on a Windows environment (local server with IIS and SQLServer) while also using Typescript may seem like a difficult task. Is it an impossible mission? Does anyone have any helpful guides, documentatio ...
My REST API delivers a JSON-formatted response that looks like this: { "Employees" : [ { "userId":"romin", "jobTitleName":"Developer", "emailAddress":"<a href="/cdn-cgi/l/email-protection" class="__cf_ema ...
My PHP application built with Codeigniter is attempting to connect to SQL Server 2016 using Windows Authentication. Encountering the following error message: Array ( [0] => Array ( [0] => 28000 [SQLSTATE] => 28000 [1] => 18456 [code] => 1 ...
I'm working on a file input field that I want to restrict to only accept XML, SQL, and text files. Here's the code snippet I have implemented so far: <input type="file" name="Input_SQL" id="Input_SQL" value="" accept="text/plain,application/x ...
Initially, I saved my JSON data in a varchar column. Recently, I was asked to modify one of the fields in the JSON. How can I extract the specific field and update its value? Here is an example of a single record: { "name": "Bob", isSelected: "true" } I ...
I am working with a MSSQL document that I need to convert to MySQL. One of the fields in MSSQL is named IMG and it has an image type, represented by a code similar to this: 0xFFD8FFE000104A46494600010101006000600000FFDB00430001010101010101010101010101010 ...
Why is there a difference in how these two methods establish a connection to the SQL Server? sql_server = 'myserver.database.windows.net' sql_database = 'pv' sql_username = 'sqladmin' sql_password = 'password1' sql_driver= '{ODBC Driver 17 for SQL Serve ...
I recently started learning nodejs and ran into an issue with my code. While following the SQL Server documentation and a tutorial on Youtube, I realized that my function is terminating after the request is complete, even though I am using .then() with bc ...
I am currently experiencing an issue with trying to access a table named dbo.Index from SQL Server in my node js express application. Unfortunately, whenever I attempt to do so, the operation fails and returns no data. Below is the code snippet in questio ...
I am currently utilizing node-mssql in my project with the following function: const getPoliciesDue = async (userId, toDate) => { const db = await sql.connect(config) // const sql = require('mssql'), config = {config for my DB} const request = db.r ...
I have successfully set up a database in SSMS with tables like Products, Subcategories, and Categories. I can run queries in SSMS and connect it to Node.js. My next task is to create a form that prompts the user to select a category from a dropdown list. U ...
Lately, we have incorporated the usage of FOR JSON PATH in our SQL code for various reasons. However, I am currently facing a slight issue in a specific scenario. My aim is to obtain a JSON string containing a list of OrderItemIds. Instead, what I am getti ...
Currently, I am faced with the challenge of displaying an image that is stored in an MSSQL database created by another person. The column was originally of type IMAGE, but I converted it to varbinary(MAX) using Sequelize. Although I lost some data during ...
I need to construct a table in a view utilizing the output of this particular SQL Query SELECT f.empresaid, e.fantasia AS Company, f.filialid, f.fantasia AS Branch, u.consultorid ...
Working on my node/express project with Prisma and using SqlServer as the db. After completing all setup, everything seems to be functioning perfectly. Running prisma generate, prisma migrate, and prisma introspect from the CLI all work flawlessly with my ...
Currently, I am utilizing the mssql npm package to communicate with SQL server. I have encountered a dilemma where the variable (which is of type TIMESTAMP in sql server) fetched from a stored procedure is returned as a byte array. Now, I need to pass this ...
I've been attempting to flatten a dynamic JSON structure and insert the resulting data into a SQL Server table without success. I've explored several methods thus far: Copy Activity: The JSON data from a datab ...
My task involves comparing the number of rows in Azure SQL databases to ensure data quality. With approximately 50 database tables and occasional additions of new tables, I aim to develop a Python script that can connect to three environments and generate ...
I have the SQL Table 1 shown below: id name gender age country ambition 1 Peter Male 20 Italy Doctor 2 Angeli Female 30 Australia Lawyer I need to insert data into another table using a similar approach. Here is how I want the output in SQL Tabl ...
After executing the following SQL Server query, I successfully created a JSON object: SELECT Attribute 1, Attribute 2, Attribute 3,... AS Identifier FROM Table_1 tbl1_obj INNER JOIN Table_2 tbl2_obj ON tbl2_obj.Id = tbl1_obj.Id FOR JSON AU ...
JSON data is stored in a column called 'DataJson' within a table [{ "KickOffDate": "1-Jan-2019", "TeamSize": "11", "ClientEngineer": "Sagar", "WaitingPeriod": "16.5" }] A query is performed to extract specific values from the JS ...
Whenever I input a sentence containing single quotes, an error occurs due to Sequelize interpreting it as the closing string. How can I resolve this issue? I attempted using the sqlstring module without success. (I am aware that doubling up the single qu ...
I'm currently facing an issue with a table in my database where the field JSONDetail stores JSON data. The problem arose when we encountered unescaped double quotes within one of the values in this field, likely due to migrating from a system that allowed ...
I'm currently working with SQL Server 2005 and node.js, utilizing the following dependencies: "dependencies": { "sequelize": "^4.42.0", "tedious": "^5.0.3" } My objective is to set up this database structure: const con = require('. ...
Encountering an issue setting up MSSQL DATABASE configuration with my codeigniter. The following files have been placed in xamp/php/ext: php_pdo_sqlsrv_56_ts.dll php_sqlsrv_56_ts.dll php_sqlsrv_56_nts.dll php_pdo_sqlsrv_56_nts.dll In addition, the dll f ...
I am attempting to upload a SQL file into a SQL server that is operating within a Docker container. Here is the docker-compose.yml file: version: '3.4' services: sqlserver: image: mcr.microsoft.com/mssql/server container_name: sqlserve ...
I recently tried running the code below and it seems like the connection is established successfully. However, I'm unable to see any output. Is there a way to view the query result? I am still learning about Protractor, NodeJS, and MSSQL connections. cons ...
I've been trying everything, but I just can't seem to get one query to function properly. My goal is to retrieve information from the SQL Server database in two separate queries - one for album names (based on URL parameter) and another for song ...
I need assistance with a query that can generate JSON output for creating a menu structure. I want to populate the Menu using this JSON data. Below are the details of the two tables I am working with and the query I have tried so far: SELECT c.ID As ...
I am looking to make changes to an existing JSON value within a JSON array. I have the ability to add a new JSON object to the array using JSON_MODIFY. For example, if my JSON looks like this: [{"id":"101","name":"John"}, {"id":"102","name":"peter"}] How ...
Having some issues with my code to establish a connection to SQL Server from express.js. I'm trying to handle errors by assigning them to a global variable and returning it at the end of the function, but for some reason the value is always undefined. ...
I'm attempting to fetch multiple rows using the SQL Server 2017 TSQL code from a JSON object. DECLARE @json NVARCHAR(MAX); SET @json = N'{ "DateCreated": "2020-08-02T16:04:59.3558001+01:00", "Name": "Bolts", &q ...
Exploring the realm of JavaScript, I am currently delving into Node.JS to interact with an API and save the data in a SQL Server. Utilizing the "request" and "mssql" Node packages for this task as they possess robust documentation and support. My query re ...
Has anyone had experience connecting to MSSQL using PHP? I am currently running a MAMP server and utilizing PHP as the server language. While I have successfully connected to MySQL, I am now needing to connect to another database in MSSQL. I attempted to ...
I am currently using a dedicated CentOS server that needs to establish a connection with a remote Windows machine running SQL Server 2012. The provider has installed Freetds, and my PHP version is 5.3.28. We are able to ping the remote MS-SQL server from ...
Seeking guidance on testing outdated legacy asp.net web forms. Many pages in our project were developed years ago and now the task of maintaining them or adding new features has become extremely challenging. The lack of organization is evident, with no de ...
I'm encountering an issue while attempting to insert data into the 'products' table within my SQL server. Despite my efforts, the table remains empty and I'm unsure about what's causing this problem. Here's a snippet of my code: <?php /* Defining the ...
I'm currently experiencing difficulty in utilizing FullCalendar's impressive jQuery calendar plugin for my application, specifically in generating events from SQL Server. Here is the code snippet: First JS $(document).ready(function() { var date = ...
My understanding of SQL's locking mechanism has been challenged recently. I know there are shared and exclusive locks, and that multiple shared locks can be applied to the same data simultaneously. However, I am confused as to why query 1 does not block qu ...
My database in SQL Server contains a table with two columns: ID and JSON. The JSON column holds JSON-formatted text. I have access to functions like ISJSON, JSON_VALUE, and JSON_QUERY, but unfortunately not OPENJSON. I'm attempting to write a query t ...
I am facing a situation where I have a table in my database with columns ID and Data. The data in the Data column consists of JSON objects containing "na" and "answer" fields. ID Data 1 [{"na":false,"answer":1.5},{"na ...
I am working with a dimension table that includes a JSON column and applying SCD Type 1 to update its values. string1={ "Name":"Suneel","Age":23,} String2={"Name":"Suneel Kumar","Age":23,"Cit ...
I am currently scraping data from a website using Cheerio. Can someone provide me with guidance on how to retrieve web data and automatically update it using socket communication when there are changes on the website? I want to make this process real-tim ...
Here is some sample input data for your reference: if object_id('tempdb.dbo.#store_data') is not null drop table #store_data create table #store_data ([key] nvarchar(max),[value] nvarchar(max), storeid varchar(100) ) INSERT INTO #store_data VALUES ('sid ...
Greetings, I am currently working on a full stack login form. The issue I am encountering is the error message ": Cannot set headers after they are sent to the client," which you can review in the full log provided below. My main goal is to develop a logi ...
I've been attempting to establish a connection between node.js and mssql in Windows Authentication mode. Despite installing the modules tedious,mssql, and msnodesqlv8, I'm still struggling to open a connection. This is my failed attempt so far: ...
Having successfully connected to sqlserver using ODBC in php, I am able to establish a connection with the database and execute queries. However, the results I receive are not as expected. A notice is being displayed: server connected Notice: Use of un ...
Upon receiving a valid JSON string from the client side, which contains an array of integer values: declare @JSON nvarchar(max) = N'{"Comments": "test", "Markets": [3, 151]}' The question arises on how to accurately select the market IDs. When attemptin ...
Encountering the error mentioned above consistently. The issue arises with my setup depicted below: $InsertSQL = "insert into reports.NonVarassetInvoices(State, CLLI, Type, Vendor, DateReceived, InvoiceNumber, InvoiceDate, TotalInvoiceAmount, ProjectWONum ...
I just started using pytds and encountered a TypeError: not enough arguments for format string error when trying to insert data into SQL Server. The problem I'm facing is: Traceback (most recent call last): File "c:/Users/mydesk/Desktop/test/test_p ...
I am recently starting to explore the world of node.js and I'm currently working on establishing a connection to SQL Server using the mssql library. However, I find the example provided in the git repository to be quite vague, leaving me uncertain about ...
I am currently working on a project that involves dynamically populating two drop down menus using SQL Server. Depending on the selected items, I need to load a specific ejs template using AJAX. My goal is to load data based on the selected criteria. For e ...
I've been grappling with this issue for quite some time and I just can't seem to figure it out. Here is the code snippet that I have been using: const sql = require('mssql/msnodesqlv8'); const pool = new sql.ConnectionPool({ server: '127.0.0.1', data ...
I am working with a function called xyz_users_list that returns a list of users when executed using exec xyz_users_list. How can I incorporate this into my nodejs application? Code index.js 'use strict'; const express = require('express'); const app = ...
Is there a way to eliminate spaces using the given query? The second input value (" DEF") and third input value ("GHI ") contain extra spaces. How can we remove these spaces? Here is the original query: SELECT * FROM openjson('[{"value":"12","te ...
I am struggling with properly formulating a question in order to retrieve relevant search results. I am attempting to extract data from a third-party API (ADP) and store it in my database using asp.net core. My goal is to save the users obtained from the ...
Let's imagine we have a basic SQL table: CREATE TABLE CarTable ( Model CHARACTER(10), Brand CHARACTER(10) ) Now, let's say we have added the following data to this table: INSERT INTO CarTable (Model, Brand) VALUES ('Thunderbird', &ap ...
The following code snippet is from the index.js file. Upon visiting the link "localhost:300/admins/", the code is supposed to establish a connection with SQL Server and retrieve the result on the console. I confirm that my Microsoft SQL Server Management ...
I am currently facing an issue while attempting to save a file, such as an image, in the Microsoft SQL Server Management Studio through asp .NET core for the Rest API. I have managed to create a base64 representation of the file, but I am unsure about the ...
Encountering a "Fatal error: Invalid handle returned. in" message in PHP 7 when attempting to connect with SQL Server. Tried the following options: Error connecting to MSSQL with SQLSrv and PHP 5.4.7 Unable to connect to SQL Server with PHP The code bei ...
Everything I've come across regarding the topic revolves around using a NodeJS program to call a stored procedure. Inquiring: Is it feasible to reverse this process? Can a stored procedure be designed to call/execute a NodeJS file/program instead? I'm cur ...
In my SQL server table, I have the following data: Name Value ValueHash city 111 zzz address 333 yyy email [email protected] xxx name 222 www I need to retrieve the JSON format shown below using a SQL query { "address": { ...
Looking to create a REST service using Node.js and Express but facing difficulties connecting to a SQLServer 2000 database. The Microsoft connector is not compatible with Linux, as mentioned by the developers: The Microsoft Driver for Node.JS for SQL Se ...
My current project involves using PHP code to post data submitted through a web form to a database table. However, despite my efforts, the data is not getting stored in the database. I have another similar page where the data posting works correctly with t ...