Design a multi-tenant schema with composite keys, tenant-first indexes, trusted session context, and row-level security checks.
Unique Pairs in Either Order: Blocking A-B When B-A Exists
A plain unique index treats (1, 2) and (2, 1) as different rows. Two computed columns and one index fix that, and I test the awkward cases.
SQL SERVER – Curious Case of Disappearing Rows – ON UPDATE CASCADE and ON DELETE CASCADE – Part 1 of 2
Rows kept vanishing from a product table with no DELETE anywhere in the code. Part 1 of a puzzle that leads to ON UPDATE CASCADE and ON DELETE CASCADE.
Time-Limited Access: Expiring Grants With a Valid-Until Column
A ValidUntil column does nothing by itself. Here is how to make the read path enforce it, with a demo you can run.
JSON_PATH_EXISTS and Typed ISJSON in SQL Server 2022
Validate payloads with JSON_PATH_EXISTS and typed ISJSON in SQL Server 2022, distinguish null from missing, and enforce a clear contract.







