Two DBAs edited the same stored procedure directly in production on the same day. The second save silently overwrote the first DBA's fix, and nobody could say which version had been running the previous week. What practice prevents this?
Select an answer to reveal the explanation.
Short Explanation
Editing code straight in production is like two writers typing over the same page with no undo button. Put your scripts in version control and you get every change with an author, a time and a history, and it catches conflicts before they overwrite each other. Backups are for recovery, not for figuring out who changed which line on Tuesday.
Full Explanation
Version control systems record every change to source files with an author, timestamp and description, support branching and merging, and detect conflicting edits before they overwrite one another. Treating stored procedures, views, functions and schema scripts as source code in version control, and deploying production changes only from the repository, gives a complete history of what ran when and allows a known version to be redeployed quickly. Editing only in production guarantees a single copy but provides no history, no conflict detection and no review, which is exactly how the overwrite happened. Emailing scripts creates scattered, unsearchable copies with no authoritative version and no protection against two people changing the same object. Nightly backups can recover an older version of a procedure in principle, but only at daily granularity, by restoring a whole database somewhere, and without any record of who changed what or why; they are a recovery mechanism, not a change history. Exam caveat: version control is one element of change management alongside change approval, release schedules, CI/CD and database refresh, and its value depends on discipline that production changes always come from the repository. Operational check: script all programmable objects into a repository, restrict direct DDL in production to the deployment account, require pull requests for changes, and periodically compare production object definitions against the repository.