Category "sql-server"

MS Access 2016 decrypt field that is encrypted in linked ODBC SQL Server table

I need to encrypt SSN (nvarchar(25)) field in a SQL Server database table. Once encrypted, the Access program needs to be able to decrypt the field for user vi

Alternative for count()

I have used the count() function to calculate each of the rows values select course, count(*) course_count from student_table group by course; Without using

How do I solve SqlNullValueException?

I'm trying to find an entity but I get a SqlNullValueException when entity framework is trying to get the value of a field that's Null. I checked in the databa

How to do a "Select * from" query using odbc

I'm using the odbc package in R, and I have an SQL Server database with a table that has a Name column that is nvarchar(max) and a PublishStatus column that is

TSQL Subquery in from

I am attempting to do a subquery which should work but I am missing something in the syntex. I am trying: select * from (select * from (select *, row_number

SQL Server 2019 > Agent Job execute > Error 'Culture is not supported'

Within the Job History logs - Error on Step 1 : "Culture is not supported. Parameter name: culture 3072 (0x0c00) is an invalid culture identifier." Prior to th

Data Connection between Excel and SQL Server

I have a dataset in Excel which I have imported in SQL Server. Is there a way in which when I make any change in the Excel data set like add/remove/edit rows or

SQL Server 2019: master db -- How to recreate ##MS_SchemaSigningCertificate in 2048 bits. VA1223

The new SQL Vulnerability assessments are flagging our database with "VA1223: Certificate keys should use at least 2048 bits" (FedRAMP Benchmark). https://docs.

Deadlock in SQL Server in simple update operation

I have a SQL command like this: UPDATE tableName SET ColA = @ColA, ColB = @ColB, ColC = @ColC WHERE ID = @ID which is executed as the sole command in its ow

Transpose results of a sql query

How to transpose this display. SeqNo Step Date By 1 Quoted 2018-03-01 Person1 2 Checked 2018-03-02 Person2 3 A

How can I write a case sensitive WHERE CLAUSE in SQL Server?

Ok, this one has me stumped. I'm hoping it's not something stupid/obvious... I'm trying to fix addresses in a client database. I have a function that takes a

When Migrating from SQL Server to Snowflake how do we migrate stored procedures

I am doing POC on Snowflake and exploring this product. I have a question: in SQL Server, we have 400-500 stored procedures and these stored procedures are get

Is there another way to write SUM(IIF([CONDITION], 1, 0))?

What SUM(IIF([CONDITION], 1, 0)) does is very simple. So simple, that what I really just want to write is COUNT([CONDITION]) (but that's invalid). Is there a sh

Are there cons to generating GUIDs with a stored procedure using NEWSEQUENTIALID?

My goal is to create a stored procedure that generates new GUIDs using NEWSEQUENTIALID that can then be used when inserting data into a different table in the s

How to deploy dacpac changes to SQL Server database hosted on azure vm

We have an Azure VM with SQL Server installed on it. We have our Visual Studio SQL Server database project in an Azure git repository. I've got the project to b

Using Pivot to remove duplicated results adding new columns

I have the following table [_teste_calendario_Table] and when "Monstrengo" has the same value, I'd like to make a pivot, adding new columns "De1", "Ate1", "Ven

How to enable "Allow Azure services and resources to access this server" through PowerShell (Azure CLI)?

After creating a new Azure SQL server using az sql server create, how can I enable the following options through PowerShell(Azure CLI)?

Unique Address SQL Query [duplicate]

I have a table like this: I would like one address for each account number, if the account number has two addresses, I want to get the one wi

T-SQL hierarchy query

I have a table with hierarchical data: This is a sample of data with id, parent id, name, code (which is sometimes not filled), level and isroot column. In r

Empty string results in "Errors were detected in the command line arguments, please make sure all arguments are set correctly"

On a SQL 2016 Server I have a job that calls an SSIS package. That package is in a project in the SSISDB and has parameters. One of those parameters is a str