Category "sql-server"

SQL- Find all students who all of their friends have score less than 10

I have to write some simple queries for my database homework using SQLServer. The schema has been provided in the question: students(student_id, name); friends(

No suitable constructor found for entity type 'CoordinateSystem'

I'm trying to generate a migration file with a spatial column in it (Geometry) and I'm getting this error No suitable constructor found for entity type 'Coordi

How to exclude escape characters from ROOT when using FOR JSON from SQL server

I am trying to create JSON output from SQL Server using FOR JSON. My JSON record is good however I have a number of elements I need in the ROOT section but this

SQL Server Reporting Service (SSRS) on Azure SQL Database [closed]

Azure SQL Database supports Full recovery model and we can't change the recovery model of Azure SQL Databases. As mentioned here while making

Incorrect Syntax near WHERE error in generated SQL

I am generating the below SQL. From my code I am using a where condition list to collect all the Where logic and insert it after the Join logic is set-up. Howev

VBA stored procedure SQL Server

I'm trying to send data from excel spreadsheet to sql server. The code runs properly but the change of status is not done. Before those steps, I already added d

Azure SQL Database: Full text index on certain emails does not work

I have a full text index defined on user table's username column. When there is any character following + symbol in email in the search query there is no result

SQL Server Change Data Capture - Validating Incremental Window

I want to implement an incremental load process using SQL Server Change Data Capture. Every example I find takes the "happy path." In other words, they assume t

SQL Replace command with Regex

So I am trying to run this SQL command Select Replace('[1,2,3,47]','%[0-9]\,|\[|\]%',''); this regex should give the following result 47 however, the original

Connect local SQL Server from WSL2 (Ubuntu) [duplicate]

I started to develop a .NET Core Web API application with SQL Server. I use the Windows Subsystem for Linux (I store the files in the Ubuntu s

SUM UP two columns and then find the find MAX value in SQL Server

I am working with Microsoft SQL Server and want to find E_ID and E_Name where T1+T2 has the MAX value. I have two steps to reach the necessary result: Find the

SQL Server: Limit filling NULL values up to row with specific text

I have a CTE on which i am filling null values with the previous value before row 100 available by using the following script SELECT [YearMonth],grp, CASE WHEN

Split Hours into Multiple Months using SQL

CREATE TABLE EventLog ( EventID INT , EventName VARCHAR(50) NOT NULL , EventStartDateTime DATETIME NOT NULL , EventEndDateTime DATETIME NULL ) INSERT IN

Why does commandTimeout raise SqlError in IDbConnection.Execute?

I have an IDbConnection to a SQL server and two stored procedures I would like to start from a console app using the Execute method on the open connection. When

SUM Values by Sequence Number and Group By Flag

We have a list with a sequence number. The sequence will break, then begin again. As you can see below, the SalesOrderLine is missing the number 4. SalesOrder

How to find all paths recursively from relational table in SQL Server using transitive property?

I would like to be able to recursively find all relationships in a table. I have a relational table, and essentially I would like to apply the transitive proper

Take the nearest row by condition in date, student frame

I am struggling to get the nearest 'Math Test' or 'Biology Test' in (+/- 3 hours) from Test= 'Marked A+' including TestOrder ordering. If 'Math Test' or 'Biolog

SQL Convert numbers into Date

I'm a beginner in SQL and I need your help please! I have a project which is convert Social Security Numbers into birth date. In the database, I have a column M

jQuery AJAX Not Returning Error Message with SQL Server

I'm testing jQuery AJAX to return data from a SQL Server table. In the AJAX call I have a failure function to show any potential errors in an alert box. However

Anonymous access to azure table

Please can someone give me guidance on how to set up anonymous read-only access to one specific table in Azure. I have a table that I want Power BI students to