Snippets
Small copy/paste solutions with short explanations. Quick fixes and reusable code blocks.
SQL Server: Bulk Update with JOIN
Update many rows from a supplied list of IDs + values using a temp table and JOIN. Ideal for data fixes.
SQL Server: Safe Bulk DELETE Using JOIN
Delete rows using a JOIN with a preview step to avoid accidental data loss.
SQL Server: Update Only When Values Change
Avoid unnecessary writes and locking by updating rows only when values differ.
SQL Server: UPSERT Without MERGE
Insert new rows and update existing rows safely without using MERGE.