Category "sql-server"

Get data from XML column

I have a table with a column of datatype XML. I want to get data by reading that XML column. Here is the XML which is stored in that column: <BizMsg xmlns:xs

Azure SQL Database, NodeJS app: failed to connect

probably someone has encounterd the same problem and have a solution. I have a SQL Database in my Azure Portal account. I have created a NodeJS application in a

How to replace starting two digit (00) with blank space in T-SQL?

I have a table where as codes are present in the form of 78,7244,d345 by default few records are found where the codes are start with 0072 . I have to delete st

Deadlock on Select from table-valued parameter

I have this piece of code which acquires connection from EF Core DB context and executes select on the received data. var conn = _dbContext.Database.GetDbConnec

Are CTE's not allowed in SQLLab?

When running the below in /superset/sqllab/ ";WITH cteData AS ( SELECT TOP (100) * FROM [dbo].[Response] ) x SELECT * FROM cteData" I get the following error:

XAMPP/SQLSRV: Unable to find Sqlsrv in PHPINFO(); - errors coming from connection

I'm attempting to connect into a SQL Server DB I have hosted on my Linux VM. I'm running xampp on my development windows machine and the connection is coming fr

How do I backup a database with a stored procedure in SQL?

I'm trying to create a stored procedure that backs up a database, however whenever I execute it, the folder I'm trying to backup to remains empty. Here is my st

How to update a value in column based on value from other table in SQL server?

I have two tables match_score and match_condition I want to update table match_condition and set values of innings, first_4, etc. Here's the example in which I

Get first day of sequence SQL

I would like to get first day of continuous date sequence. Query is valid for one month. I am using SQL Server 2014. Table example: Id | VechicleISO | RideISO |

SQL Server : finding substring using PATINDEX function

I'm writing different queries in SQL Server. I have 2 tables, Employees and Departments. Table Employees consists of EMPLOYEE_ID, ENAME, ID_DEP - department id.

Cannot initialize the data source object of OLE DB provider "OraOLEDB.Oracle" for linked server

I am trying to query data from linked server. It is giving me the following error: TNS:listener does not currently know of service requested in connect descrip

How to detect where SET IMPLICIT_TRANSACTIONS ON?

I have a c++ application and run it on SQL Server 2019 server1\db1 - it works fine server1\db2 - it works strange The app works different. I have detected in Pr

EntityFramework is very slow to compare strings because create a nvarchar sqlparameter instead of varchar

I have this sample query: context.BarcodeTipiDoc.AsQueryable().Where(d => d.Barcode.CompareTo(minBarcode) > 0); That query runs very slow because Entit

SQL Server - Combine two select queries

I have two tables, Semester1 and Semester2. Semester1: StudentId SubjectId abc sub1 def sub1 ghi sub1 Semester2: StudentId SubjectId abc changedSub1 def sub1

How to fix Only one top level element is allowed in an XML document error when parsing and A string literal was not closed error into SQL Server

I am trying to extract the data from an XML file that has many duplicates and if I change the name it is not showing anything in the result, I am not able to do

How to remove the first word from a large string

I want to remove the first word from a large string in SQL Server. Input string: 931078027 BP 16:20:0:13 25 BAG 'B' CLASS Desired output: BP 16:20:0:13 25 BAG

Cannot connect to SQL Server Browser. Ensure SQL Server Browser has been started

I'm trying to connect my ASP.NET Core MVC application to SQL Server. I'm using the Visual Studio for mac. I wrote the connection string like below : "Connect

Extract all records from a JSON column, using JSON type

I have a couple tables (see reproducible code at the bottom): tbl1_have id json_col 1 {"a_i":"a","a_j":1} 1 {"a_i":"b","a_j":2

Can't connect wpdatatables to ms sql database

I want to connect the Wordpress pluggin wpdatatables to my Ms sql database, but every time i try it appear the next message: "wpDataTables could not connect to

How to fill a datagridView with my stored procedure on load

I have this stored procedure that selects the top 10 results from its inner join CREATE PROCEDURE SP_SELECT_DOCS_WHERE_JOBID_STATUS @JobID INT, @BatchID