Everyday DDL and Idempotent Scripts: IDENTITY and SEQUENCE, Computed Columns, CREATE OR ALTER, DROP IF EXISTS and Synonyms
A rerunnable deploy script ties every step to an OBJECT_ID/COL_LENGTH check, uses CREATE OR ALTER for views and procedures and DROP ... IF EXISTS for the rest, and wraps DDL in a transaction with XACT_ABORT ON. With real output: where identity and sequence gaps come from, IDENTITY_INSERT and CHECKIDENT, a shared order number sequence, PERSISTED computed columns, a view broken by sp_rename, and synonyms; the last post of the series.
15 Nov 2026
·
17 min
·
9