Category "sql-server"

Using Count + STRING_AGG, to display distinct values

I am trying to use COUNT with STRING_AGG. The problem is that in a subquery it counts as needed and I have count 1 when it's 1 employee that is taking the cours

Bulk Insert SQL Server FROM network file

Can't seem to get this bulk insert to work. I know the SQL Server windows account has appropriate permissions to this network folder - that has been verified. T

SQL Server Agent alert

I hoping there is a way to get an email alert for which a new distinct data has been inserted in to a column in my views found in the SQL Server Agent - job?

How to find the cause of occasional slowness in .NET WebApi

I am investigating some occasional slowness in a aspnet Webapi method (.NET 4.8, not core). The symptoms are that most of the time the API responds in a few ten

Why is my filtered index not being used for one statement?

I have the following table (an excerpt follows w/o other columns): USE [opg-systems-dev] GO SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE TABLE [db

Getting 'com.android.tools.r8.internal.Hc: Sealed classes are not supported as program classes' when trying to load Microsoft SQL Server JDBC

I'm using android studio to connect to a Microsoft SQL Server and I can't use the JDBC for JDK 17. It just appears with the following error message: 'com.androi

Is there a way to check that none of the rows in a grouping contain a value?

I have a query that looks like this: SELECT ordDetails.OrderId FROM orders.OrderDetail ordDetails WHERE ordDetails.Class <> 'O' GROUP BY ordDetails.

Microsoft SQL Server Express: this version of the installer is no longer supported

I'm trying to install Microsoft SQL Server 2019 Express but I keep running into the above error message. I was originally running into a separate error message

Creating A Stored Procedure That Truncates A Table With Foreign Keys

I would like to make a stored procedure in SSMS that will truncate a table that has foreign keys. Here is what I have right now but when I pass a table with for

Connection with SQL Server: java.sql.SQLException: No suitable driver found for jdbc:sqlserver

I am trying to connect a little Java App to a SQL Server database using Visual Studio Code. This is my code: import java.sql.*; public class App { public st

Find the total amount for each day. Amount calculated from all previous days if day is not Monday

This was a question asked in a BI Engineer interview. I could not solve it and still scratching my head around it. Although, I used lag window function using ca

SQL Over/Under Column Comparison

I am trying to pull rows where the Net_Qty is +/- 300 of the Order_Qty, but I think I might just be missing something with the syntax. SELECT DISTINCT o.Ord

PHP Deprecated: Automatic conversion of false to array is deprecated adodb-mssqlnative.inc.php on line 154

We are upgrading PHP to version 8.1. Using MS Sql Server DB. It all seems to work correctly but I see repeated messages in the log file: [03-Feb-2022 11:51:18

Issues while Using Nested DB Link queries in AWS RDS SQL Server

I have three DB servers and looking to establish a Link Server connection among them to periodical. A - AWS RDS SQL Server database B - SQL Server database on A

Return Monthly Revenue based on a start and end dates

I am looking to create a query that would return the individual monthly revenue for the next 12 months. The revenue amounts are currently stored by projectid an

The datetime columns in all the tables on SQL server have shifted by a few hours

I've created a few tables all of which had a column of datatype datetime. Recently, I think after the daylight savings adjustment, for some reason all the dates

How to make SqlPackage exclude indexes?

We're using SqlPackage to generate scripts via the Script action. Does anyone know a way to get it to exclude indexes? Can't seem to find a way. The SqlPackage

Insert NON-DUPLICATE Data into SQL Database from Excel file using ASP.NET Core 3.1

I'm trying to use two C# DataTables like below to meet my requirement. dtExcelData: This DataTable holds the data which is uploaded from Excel file. This data s

Is there a way to validate data type lengths in Pandas when using the read_csv function?

I'm trying to put some sort of length validation for columns using Pandas. For example, let's say I have a csv named test.csv that has the following data within

How do I recursively select rows where values in one column are present in another column?

I have a table like below with two columns Person and Supervisor. Person Supervisor 1 3 2 3 3 4 I want to select rows where the Supervisor column only has val