I need to write some SQL update scripts to add tables, rename columns, etc. I put everything inside a transaction:
IF EXISTS ()
BEGIN
END
ELSE
BEGIN
BEGIN TRANSACTION
ROLLBACK
END
Now, if I ROLLBACK
upgrade instead COMMIT
, can I assume that later, when I put it back in COMMIT
, it will work? I don't want to apply it to my dev database yet, but I can click F5
and check if everything is ok.
source
share