Why does this SQL counter lose updates?

Why does this SQL counter lose updates under concurrency. The SQL code reads then writes without locking, so concurrent increments overwrite each other. In SQL services this undercounts events.

#whatswrongwiththissqlquery #sqlbug #sqlproductionbug #sqldebugging #sqldatabase #sqlcodereview #sqlperformance #sqlreliability #sqlanalytics #sqldataintegrity #sqlengineering #sqlracecondition #sqlcounterbug #sqlcon...

https://www.youtube.com/watch?v=_Al7OSnYuPM

Why does this SQL counter lose updates? #sqldebugging

YouTube

Are you a data professional working with:
▫️SQL Server
▫️#Azure SQL
▫️SQL in #Fabric
▫️#SQL Tools

Get ready for SQLCon 2026, March 16–20, 2026, in parallel w/ FabCon 2026!

✅ Announcing #SQLCon 2026: Better Together with #FabCon! | #Microsoft Community Hub
https://techcommunity.microsoft.com/blog/sqlserver/announcing-sqlcon-2026-better-together-with-fabcon/4466701

Announcing SQLCon 2026: Better Together with FabCon! | Microsoft Community Hub

We’re thrilled to unveil SQLCon 2026, the premier Microsoft SQL Community Conference, co-located with the Microsoft Fabric Community Conference...

TECHCOMMUNITY.MICROSOFT.COM