UPDLOCK and READPAST let SQL Server queue workers claim different rows safely when transactions, retries, and completion rules are designed.
Picking Random Winners Fairly With NEWID and CRYPT_GEN_RANDOM
Pick random winners with NEWID or cryptographic randomness, handle weights and unique entrants, and save a draw with its seed and timestamp.
log_reuse_wait_desc: Why the Transaction Log Will Not Shrink
log_reuse_wait_desc tells you why SQL Server cannot reuse its transaction log, so you know why a shrink gives nothing back. This post causes LOG_BACKUP and ACTIVE_TRANSACTION on purpose in a test database on SQL Server 2025, measures the log and fixes each one.
Gapless Invoice Numbers That Restart Every Year
Finance hates a missing invoice number. A small counter table and one short transaction keep the numbers gapless and restart them each year.
Insert Multiple Rows in SQL Server: SQL in Sixty Seconds #024
To insert multiple rows in SQL Server, use separate INSERT statements, UNION ALL or one VALUES list. The tests here compare all three on SQL Server 2025, including failures, the 1,000 row limit and the time for 1,000 rows.







