Snapshot-Isolation

Tag: snapshot-isolation

How to Stop SSDT / Database Projects / SQLPackage from Modifying Database Options

How to Stop SSDT / Database Projects / SQLPackage from Modifying Database Options

SQL Server’s free state-based version control tooling was introduced under the ‘Data Dude’ brand, then became known as ‘SQL Server Data Tools’ (SSDT). Its extension for the (now dying) Azure Data Studio IDE is called ‘SQL Database Projects’. If you need to find documentation, you often need to know to search for specific component names like SQLPackage.exe, which is a command line utility used to deploy SSDT Projects AKA SQL Database Projects.

Continue reading

Lost Updates Under Read Committed Snapshot Isolation (RCSI)

Lost Updates Under Read Committed Snapshot Isolation (RCSI)

I shared an image on social media this week that describes how I feel about isolation levels in SQL Server (and its various flavors): the more concurrent sessions you have in a database reading and writing data at the same time, the more attractive it is to use version-based optimistic locking for scalability reasons.

There are two isolation levels in SQL Server that use optimistic locking for disk-based tables:

  1. Read Committed Snapshot Isolation (RCSI), which changes the implementation of the default Read Committed Isolation level and enables statement-based consistency.
  2. Snapshot Isolation, which provides high consistency for transactions (which often contain multiple statements). Snapshot Isolation also provides support for identifying update conflicts.

Many folks get pretty nervous about RCSI when they learn that certain timing effects can happen with data modifications that don’t happen under Read Committed. The irony is that RCSI does solve many OTHER timing risks in Read Committed, and overall is more consistent, so sticking with the pessimistic implementation of Read Committed is not a great solution, either.

Continue reading

The SQL Server Data Row Size Question: Why Is It Bigger?

The SQL Server Data Row Size Question: Why Is It Bigger?

This morning, I received the following question from a user:

Could you please clarify SQLServer “Data Row” size: If I run the script below on SQL Server 2012, then Slot(row) Size is 710 bytes if I run the same script against SQL Server 2016 and above, then Slot(row) Size is 724 bytes.

They then provided a script which creates and inserts a few rows into a sample table, runs the DBCC IND command to find a list of pages for the sample table, then uses the DBCC PAGE command to examine the page.

Continue reading

Row Width Impact on Version Store Usage under Snapshot Isolation

Row Width Impact on Version Store Usage under Snapshot Isolation

A question came up in my webcast today on the topic of Snapshot and Read Committed Snapshot Isolation - what impact will enabling these have on my SQL Server instance?

Continue reading