Category "sql-server"

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

Is it possible to upgrade the edition of a GCP Cloud Sql Server Express instance?

I have a number of GCP Cloud Sql SQL EXPRESS 2017 instances that I'd like to upgrade to standard editions. Ive considered just spinning up a standard edition in

SQL Server - LEFT JOIN two JSON objects on a common property

I have a table with a column holding the schema (key, type) of a JSON object, and another table with a column holding instances of objects described by that sch

Insert null value into SQL Server database

I have this code public void insertAssignment(long mediaEvent_ID, long mediaBranch_ID, int? isPremiere, int? isNew, int? isLastChance, int? isPrevShown, int

SQL query - How to increase the salary of employees, without exceeding a certain salary limit

I am trying to get a query that will allow me to increase the salary of people who earn less than 2000, but I don't want the salary increase for these people to

TLSv1.2 on tomcat jdbc connection

My project setup uses mssql, tomcat9.0.59,java 1.8_322 and MSSql driver is mssql-jdbc-10.2.0.jre8.jar. TLS 1.2 is enabled database server, after patching. Quest

TLSv1.2 on tomcat jdbc connection

My project setup uses mssql, tomcat9.0.59,java 1.8_322 and MSSql driver is mssql-jdbc-10.2.0.jre8.jar. TLS 1.2 is enabled database server, after patching. Quest

system.net.http version confusion between VS 2019 and SQL Server 2016

I've found lots of reported issues related closely to this, but nothing that's quite a match. I'm building a very simple C# class, with the intention of adding

SSIS Extension for Visual Studio 2022

I have downloaded and installed Visual Studio 2022. Then after click on modify Now, I want to create SSIS package, for this I have started VS22 and in "manage

Is there a way to store full DDL of View or Procedure definition from another database in separate table

I'm trying to store DDLs of some views and stored procedures in a separate table in the Dump database. There are too many similar databases on the server. But s

How can I extract parameter names and values from within a currently running stored procedure in SQL Server?

I'm building a stored procedure to log table/procedure and need to be able to pull (not specific to current stored procedure) all parameter names and values. Th

Insert of records into SQL Server is slow whereas select is quicker

I am trying to improve the performance of insert in SQL Server. INSERT INTO [dbo].[GroupCustomerAccountProductRebates]([GroupId],[GroupName],[ProductId],[Manufa

Iterate through a list of servers in SQL Server

I have a script similar to below and get: Could not find server '@CURSERVER' in sys.servers. Verify that the correct server name was specified. If necessary, e

panda df not showing all rows after loading from MS SQL

I'm using Pandas with latest sqlalchemy (1.4.36) to query a MS SQL DB, using the following Python 3.10.3 [Win] snippet: import pandas as pd