30 questions from the last 30 days
-1
votes
0
answers
20
views
GUID v4 vs GUID v7 as SQL Server PK [migrated]
I've heard a lot that UUID v7 is performing much better in databases, when using it as primary key, due to the nature of how B-tree works. We have a huge problem with current implementation of PK as ...
Best practices
0
votes
2
replies
96
views
T-SQL ETL update evaluation recommendation: What is the most elegant & performative way to evaluate a source value to update a target value?
What recommendations might be offered for the most elegant and performative way with T-SQL to evaluate whether a source value should update a target value, as part of an ETL update process in which ...
Best practices
0
votes
4
replies
139
views
How to ensure an inserted row survives a rollback?
In SQL Server, I have a stored procedure that returns some sensitive data to the client, and logs that fact into a log table. The stored procedure is executed in a transaction controlled by the client,...
0
votes
0
answers
47
views
Gemini CLI and MCP of SQL Server extension
From reading:
https://docs.cloud.google.com/sql/docs/sqlserver/pre-built-tools-with-mcp-toolbox#mcp-configure-your-mcp-client-geminicli-sqlserver
I get this error:
✕ Error during discovery for MCP ...
0
votes
1
answer
86
views
SqlBulkCopy is failing to save records with an error "The given ColumnMapping does not match up with any column in the source or destination."
I have table defined like this:
CREATE TABLE [staging].[tbPositionAssetIdentifier]
(
[StageID] [int] IDENTITY(1,1) NOT NULL,
[AssetId] [nvarchar](50) NULL,
[SecurityDescription] [nvarchar]...
0
votes
0
answers
64
views
Export from SSMS to Excel using a .bat file. Issue with commas
I have a .bat file that creates a duplicate of the TblPIF table and names it TblPIF_New. It runs the Replace_IC.sql file which places " around the text in a particular column that contains commas ...
0
votes
1
answer
221
views
Inner join performance issue
I'm experiencing a performance issue with the following query, specifically caused by the join condition
AND edh.EmployeeCode = e.EmployeeCode
After analyzing the execution plan, I noticed that SQL ...
0
votes
0
answers
76
views
Glue Job connection with SQL Server hosted on EC2
I have created a Glue JDBC Connection for my SQL Server running on EC2.
I tested the connection with Visual ETL in the following way:
Used SQL Server as source
Selected my SQL Server connection in ...
3
votes
2
answers
147
views
Return rows from a group of rows if a specific value does not exist within the group
Based on the table values shown below, I am trying to return all rows for each Name, Activity, and Date when 'No Activity' is not in the Activity column for those dates.
I attempted the following but ...
0
votes
1
answer
54
views
Set-SqlColumnEncryption fails when dropping unrelated scalar function
Set-SqlColumnEncryption keeps failing, it's trying to drop a scalar function that is completely unrelated to the table columns being encrypted, thus failing.
$smoDatabase = Get-SqlDatabase -...
-3
votes
0
answers
24
views
Issue with Query Store Showing “Restricted Text” in Azure SQL Managed Instance [duplicate]
I am experiencing an issue with Azure SQL Managed Instance where some of the long-running queries in Query Store are displayed as “Restricted Text” instead of the actual query text.
Details:
...
0
votes
2
answers
121
views
How to perform skip and take in Linq with joining multiple tables in optimized way
How to write a linq query that does the same as this SQL statement:
select *
from [dbo].[LitEdit] as le
inner join [dbo].[LitEditJob] as lej on lej.BulkEditId = le.Id
inner join [dbo].[...
2
votes
3
answers
170
views
SQL Server stored procedure passed a Biztalk XML message not returning field values when parsing the XML text
Our integration team want to send a XML parameter from their Biztalk server containing values to be written to a SQL Server table using a stored procedure, and have sent me an example for me to create ...
1
vote
0
answers
164
views
Using non hard-coded values for test conditions within VS SQL Server Unit Test Project
Is it possible to use non hard-coded values for asserting scalar values in VS SQL Server unit test project? Below I have the variable @ResourceId that I'd like to test against the value of a column ...
-2
votes
1
answer
175
views
Updating a table with CASE
In this example I wanted to replace every NULL value in the Quantity column with the mean of the column. I'm using CASE here to achieve that but what ends up happening is instead of replacing NULL ...