How to undo SQL changes using installer
- by Sunil Agarwal
I have installer to install procedures, scripts, views, etc in SQL server 2005/2008.
Now I want to add a condition in the installer like if there is any error while installing, I want to undo all the changes done in SQL server.
I tried to store the procedures, views, etc which I am changing while installing and reverting them back if I get any error. But am not able to do it the way I want.
Can someone guide me if he had done the same thing?
To specify I am using WIX installer.
Also if someone has tried SMO, it will be of great help.