Category "sql-server"

How to properly use JPA/Hibernate?

I'm trying to understand annotations better with JPA / Hibernate and SQL Server. I created a simple project: an abstract class named "Articles". Two classes inh

A simple function to query MSSQL then close the connection for use in quick scripts

I have a script that I want to be able to schedule to run periodically, and query a DB, open a connection, execute a query, then close the connection. Trying to

Display percentage of registered members that have not rated a Movie

I have the following three tables. See full db<>fiddle here members member_id first_name last_name 1 Roby Dauncey 2 Isa Garfoot 3 Sullivan Carletto 4 Jac

How do I fix SQL Server Database Project Ambiguous References?

I am having trouble getting Visual Studio 2022 (and 2017) to work with a simple Database Project. I have extracted a data tier application and stored it as a .

How to have docker compose init a SQL Server database

I have a docker compose file which creates a starts SQL Server. This is working fine. I can connect to the database and see the master database. What I am tryin

System.Data.Entity.Core.MetadataException: 'Unable to load the specified metadata resource.' 2022

[Enter image description here] 1 I got this error when I tried to run the system. I am not sure why. it used to display the information from a database. Please

Select Statement inside of

I get error "Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >, >= or when the subquery is used

How to run an Azure SQL Server Stored Procedure using an Automation Account Runbook with Managed Identity?

I am trying to run SQL Server DB index and statistics maintenance activating a stored procedure called AzureSQLMaintenance with a PowerShell Runbook in Automati

Sequelize dialect dependency on msnodesqlv8

We are using sequelize package to connect to mssql server. Our backend code is in javascript. We have a working code like below: const sequelize = new Sequelize

Inserting Data to SQL Server from a Python Dataframe Quickly

I have been trying to insert data from a dataframe in Python to a table already created in SQL Server. The data frame has 90K rows and wanted the best possible

Issues connecting SQLedge to asp.net projects on m1 mac

Back Story: So I've been recently developing some c# sharp projects using a m1 Mac and a sql image (sqledge) hosted in a docker container. When trying to connec

The Query is not working when I am adding a CTE command to it , although the Inside Select Query is giving the coorect result

In First Image Only Select Statement is run , it works fine . but In Second Image when we added CTE and executed the query , it shows error. Can you please hel

SQL scripts in Dockerfile is skipped to run if I attach the deployment to a persistent volume

I create a new image base on the "mcr.microsoft.com/mssql/server" image. Then I have a script to create a new database with some tables with seeded data within

Sum of digits in string SQL

Suppose I have column with strings with digits and non-digits. For example 1a2b~#3c. How can I find sum of the digits in these strings. I can't use CTE and my q

How to multiply 2 tables in SQl

Preface: this isn't homework - I am learning SQL. I was given the problem to make a multiplication chart. Here's my solution: create table x (x int) create tabl

Failed to connect SQL Server from Node.js using tedious

I am trying to connect to SQL Server in our domain network. I am able to connect using python but not able to connect in Node.js using Tedious. Node.js code sni

DISTINCT with HASH MATCH (Flow Distinct) in SQL Server

Recently, while working in SQL Server, I got an interesting thing that removing DISTINCT keyword actually decreased my query performance and increased my search

How to convert nvarchar to date from one column to another in SQL Server

I have a column called “Month Year Raw” that has multiple nvarchar type data like this: 202201 and I want to convert that to a column called “

Structure of T-SQL tables

I am switching from MySQL to SQL Server for a new job and I have encountered something I don't quite understand as I haven't encountered something like this bef

The data types nvarchar(max) encrypted with with (encryption_type = 'DETERMINISTIC' xxx) are incompatible in the equal to operator

var countryCode = new SqlParameter("@countryCode", SqlDbType.VarBinary); var byteArray = Encoding.UTF8.GetBytes(dto.Country); countryCode.Value = byteArray; var