Timeline for Can I revert a transaction after a certain number of days
Current License: CC BY-SA 3.0
13 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Aug 27, 2017 at 9:48 | history | tweeted | twitter.com/StackDBAs/status/901743221801447424 | ||
Aug 26, 2017 at 16:20 | answer | added | Basil Bourque | timeline score: 1 | |
Aug 25, 2017 at 22:36 | comment | added | RDFozz | The only way you can roll back a change is if it's been done in an explicit transaction and you haven't committed it yet. If you're really not doing anything, or you do everything through the same connection, this could work, in theory. It is very fragile - if your connection is interrupted, all changes will be rolled back; and, other users of the environment won't be able to do much of anything with the table in question. All that said, I don't recommend it - go with Brent's answer. | |
Aug 25, 2017 at 21:32 | vote | accept | SP1 | ||
Aug 25, 2017 at 20:57 | answer | added | Brent Ozar | timeline score: 7 | |
Aug 25, 2017 at 20:55 | history | edited | Brent Ozar | CC BY-SA 3.0 |
Adding info from comments
|
Aug 25, 2017 at 20:45 | comment | added | Kris Gruttemeyer | I'd restore the backup that you took before making the changes (Which I'm sure you have, right! :) ) then run a comparison between the pre-deploy and post-deploy servers and sync them up. | |
Aug 25, 2017 at 20:30 | comment | added | SP1 | Thanks for your reply..This is a transactional db and I don't have to worry about any new data addition since this is just a staging environment..All I care about is to revert all the structural or data modifications that the SQL Script did by itself. | |
Aug 25, 2017 at 20:28 | comment | added | Kris Gruttemeyer | I use SQL Compare and SQL Data Compare for deployments like this. You can generate rollout and rollback scripts easily (by reversing the comparison direction) ahead of time so, in the event of a rollback, all you do is open the rollback script and hit F5. That only applies to fact/dimension tables though. If you're talking about transactional tables, you need to decide what you're going to do with any newly generated data since you migrated. Got any backups handy from before the deploy? | |
Aug 25, 2017 at 20:18 | comment | added | SP1 | Reverse it back..so remove the column if it was added..change the data type back etc.. | |
Aug 25, 2017 at 20:16 | comment | added | Brent Ozar | Say that the transaction involved adding a column to a table, or deleting a column from a table, or changing the data type of a field. What would you expect to happen when you undo that? | |
Aug 25, 2017 at 20:10 | review | First posts | |||
Aug 25, 2017 at 22:31 | |||||
Aug 25, 2017 at 20:09 | history | asked | SP1 | CC BY-SA 3.0 |