Category "sql-server"

How to convert hashbytes string from sql to spark equivalent

I have a process using the following select statement in sql server SELECT HASHBYTES('SHA1', CAST('4100119300' AS NVARCHAR(100))) AS StringConverted This give

SSIS package runs fine in VSTS 2019 but not in SQL Server 2017 via SQL Agent or DTEXEC

I have a very basic SSIS package with one SQL Task. It works fine in Visual Studio 2019 but doesn't run in SSMS or via DTEXEC on the server. I have my package

Transactionscope throwing exception this platform does not support distributed transactions while opening connection object

TransactionScope is throwing a exception in .net core 2.2 In this example I created a scope of TransactioScop. Opening SQL transaction for one database which is

How to Connect SQL Server to MySQL using Linked Server ODBC Connection

I'm trying to create a linked server from my SQL Server to a MySQL db. No matter what I do, I get the following error: Cannot initialize the data source object

SUM() with entries from 2 table

Select p.pnum, SUM(CASE WHEN P.NegativeScreen = 'Type99' THEN 1 ELSE 0 END) TotalDetected, SUM(IIF(P.IsPositive = 1, 1,0)) TotalP, SUM

SQL User-Defined table Type in INTO statement

I want to Create a table @tablename with data from a User-Defined Table Type but I get the error Must declare the table variable "@tablename" ALTER PROCEDURE

Can't connect to SQL Server DB from Pyodbc

I am having a difficult time trying to connect to a SQL Server DB on Linux, using pyodbc. I have a ODCINI file entry created. I started with this: import pyo

SQL Server Developer edition on Ubuntu: Allowing remote connections

I've got SQL Server 2019 Developer Edition up and running on my Linux VM. I'd like to remotely connect to that SQL Server instance from my Windows development P

SQL Server Developer edition on Ubuntu: Allowing remote connections

I've got SQL Server 2019 Developer Edition up and running on my Linux VM. I'd like to remotely connect to that SQL Server instance from my Windows development P

TypeORM + FoalTS Multiple Database Connections

For some context, I'm building an NodeJS app with FoalTS which uses Express and TypeORM underneath. My question is around how to implement multiple database con

Connecting to MSSQL from django 1.8 on Ubuntu

I need to connect to MSSQL database from Django 1.8 and preserve Django 1.8 (not upgrade to newer version od Django). I installed pip install django-mssql . ENG

SQL Reporting - No report servers were found

I am trying to configure the SQL Reporting Services (local 2016 installation) but get this exception when I open the configuration manager and enter my host nam

Can't connect to SQL Server from Jetbrains Rider after updating driver to 10.2

I'm using the same credentials as before update. It writes: [08S01] The driver could not establish a secure connection to SQL Server by using Secure Sockets La

Sqlcmd: Error: Microsoft ODBC Driver 11 for SQL Server : Login failed for user 'sa'

I am trying to execute one stored procedure using 'sa' user through perl script save this line in a perl file and execute that perl file system("start /wait s

SQL Server trigger for verifying date column doesn't work

I have a table for scheduled surgeries and I am trying to write a trigger that will print a message in case the user inserts a past date in the date column (in

Duplicate and Split Row based on value by using SQL Query?

I have set of data and wants to split multiple rows based on the column value. For Example, Source Data: Expected Output: Thanks, Lawrance A

How can I create a partitioned table in EF Core?

Let's say I have an object like this: public class ObjectA { public int Id {get;set;} public DateTime CreatedOn {get;set;} ...etc } I want to partitio

Query to return database, schema, table, column for all databases

EDIT: I have edited my original post to add some clarity. 1) Is it possible to write a query that will return database, schema, table, column, and column type

SQL How to get categories that don't contain products?

SELECT DISTINCT {c2.name} FROM {BrandCategory AS c JOIN CategoryProductRelation AS c2p ON {c.pk} = {c2p.source} JOIN Product AS p

SQL Stored Procedure Parameter set to Uppercase

I want to force a user's string input in a stored procedure to uppercase. I tried writing UPPER prior to the @parameterName but I got a syntax error. Is this