Technical Article

Techniques for Uniquely Identifying Database Records

When designing and creating a data model for a data-driven application, the records in tables must each be uniquely identifiable. By having a unique value associated with each record, individual records can be selected, updated, or deleted. Being able to uniquely identify records is so important and standard in a database system that databases allow those designing a database table to specify what column (or columns) make up the primary key.

External Article

Tales of Corporate Espionage

All good detective stories have a femme fatale. In the case of corporate espionage scandals, Celia Goodson, a seasoned businesswoman and once a glossily groomed blonde, has been involved in investigating more business transgressions to hit the City in the last three decades than anyone else of her years.

Technical Article

CLR Inside Out

This article is meant to explore these architectural issues from the bottom up, and aims to guide you through this new world. In the long run, new programming models are likely to appear that will abstract away a lot of the challenges you will encounter.

Technical Article

New SQL Truncation Attacks And How To Avoid Them

In this article I will discuss some new ideas that can result in either modifying SQL statements or injecting SQL code even if the code has escaped the delimiting characters. I will start with some best practices for constructing delimited identifiers and SQL literals, and then I'll show you new ways attackers can inject SQL code in order to help you protect your applications.

Blogs

Why Optimize CPU for RDS SQL Server is a game changer

By

One feature that I have been waiting for years! The new announcement around optimize...

Performance tuning KubeVirt for SQL Server

By

Following on from my last post about Getting Started With KubeVirt & SQL Server,...

T-SQL Tuesday #193 – A Note to Your Past, and a Warning from Your Future

By

I haven’t posted in a while (well, not here at least since I’ve been...

Read the latest Blogs

Forums

Refactoring SQL Code

By Steve Jones - SSC Editor

Comments posted to this topic are about the item Refactoring SQL Code, which is...

The Read Committed Snapshot Isolation behaviour

By Alessandro Mortola

Comments posted to this topic are about the item The Read Committed Snapshot Isolation...

Working with JSON/JSONB Data in PostgreSQL using Python

By sabyda

Comments posted to this topic are about the item Working with JSON/JSONB Data in...

Visit the forum

Question of the Day

The Read Committed Snapshot Isolation behaviour

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;
go
Then, 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