SQL: Reliably Dropping a Database in a T-SQL Script is Too Hard
I often need to create a T-SQL script that reliably drops and recreates a database each time it is executed. A common requirement is that I’m building a script to test come concept and I want to just re-run a script to get back to a known point after cleanign up all that I’ve done before. I could even just want to create a database in a particular way, and I want to make sure it doesn’t already exist.
2026-05-28
