Production Code (T-SQL Tuesday #156)
Background
T-SQL Tuesday - the brainchild of Adam Machanic and coordinated by Steve Jones (blog|Twitter) is a monthly blog party on the second Tuesday of each month. And I will...
2022-10-31
20 reads
Background
T-SQL Tuesday - the brainchild of Adam Machanic and coordinated by Steve Jones (blog|Twitter) is a monthly blog party on the second Tuesday of each month. And I will...
2022-10-31
20 reads
Scary Scalar Functions series overview
Part One: Parallelism
Part Two: Performance
Part Three: The Cure
Part Four: Your Environment
Foreword
In the previous posts, we have learned why Scalar Functions (UDFs) are bad for parallelism...
2022-10-10 (first published: 2022-10-02)
612 reads
Foreword
Not everything in the general sense, but a tool called Everything by voidtools (Download link). Usually, I have to make this distinction when googling.
No matter how great is my...
2022-09-27
37 reads
The problem
There was a need to make changes to a table with an Indexed View. Since Indexed Views must be created with SCHEMABINDING, the View must be dropped and...
2022-09-19 (first published: 2022-09-05)
320 reads
Foreword
A picture is worth a thousand words. I use screenshots daily, whether it’s to share results, how-to tutorials, point out mistakes or create memes.
None of the tools I’ve tried...
2022-08-11
45 reads
Scary Scalar Functions series overview
Part One: Parallelism
Part Two: Performance
Part Three: The Cure
Foreword
In the first two parts, we have seen why the Scalar functions (UDFs) are a problem for the...
2022-07-29 (first published: 2022-07-24)
556 reads
Foreword
This month’s invitation is from Deborah Melkin (b|t), about venting anything you want. So let’s start this rant.
There are only two hard things in Computer Science: cache invalidation and...
2022-07-29 (first published: 2022-07-12)
279 reads
Scary Scalar Functions series overview
Part One: Parallelism
Part Two: Performance
Foreword
In the second part of this series, we’ll look at how Scalar functions (or UDFs) affect performance.
If you want to follow...
2022-07-18 (first published: 2022-07-02)
563 reads
The problem
In this scenario, you have discovered that one of your Check constraints or Foreign keys is not trusted.
Maybe you’ve detected it with a sp_Blitz, dbachecks or out of...
2022-07-06 (first published: 2022-06-24)
359 reads
Foreword
I’m still surprised many people don’t realise how lousy Scalar functions (aka User Defined Functions aka UDFs) are. So because it’s my current focus in work and this Stack...
2022-06-21
30 reads
One feature that I have been waiting for years! The new announcement around optimize...
Following on from my last post about Getting Started With KubeVirt & SQL Server,...
By DesertDBA
I haven’t posted in a while (well, not here at least since I’ve been...
Comments posted to this topic are about the item Refactoring SQL Code, which is...
Comments posted to this topic are about the item The Read Committed Snapshot Isolation...
Comments posted to this topic are about the item Working with JSON/JSONB Data in...
I am currently working with Sql Server 2022 and AdventureWorks database. First of all, let's set the "Read Committed Snapshot" to ON:
use master; go alter database AdventureWorks set read_committed_snapshot on with no_wait; goThen, from Session 1, I execute the following code:
--Session 1 use AdventureWorks; go create table ##t1 (id int, f1 varchar(10)); go insert into ##t1 values (1, 'A');From another session, called Session 2, I open a transaction and execute the following update:
--Session 2 use AdventureWorks; go begin tran; update ##t1 set f1 = 'B' where id = 1;Now, going back to Session 1, what happens if I execute this statement?
--Session 1 select f1 from ##t1 where id = 1;See possible answers