Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3697946
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T04:55:18+00:00 2026-05-19T04:55:18+00:00

I have installer to install procedures, scripts, views, etc in SQL server 2005/2008. Now

  • 0

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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T04:55:19+00:00Added an answer on May 19, 2026 at 4:55 am

    The simplest and most robust way to handle this is not to use the installer at all. Rather wrap all your SQL into a transaction block. Using this means that if anything fails for any reasons (as part of the SQL) then the transaction will gracefully roll back and all your DB changes will be reverted without you having to implement any more than defining the transaction block on your SQL statement.

    Assuming MS SQL more information regarding transactions can be found here:

    http://msdn.microsoft.com/en-us/library/ms188929.aspx

    Most other mainstream SQL implementation follow a very similar model, but obviously refer to their docs instead.

    If you need to trigger “rollback” of the SQL component of your install if some other component of your install fails. Then unfortunately you can’t use transactions in this manner. However in this case you could simply call a rollback script that deletes any SP’s / tables etc you have added. That said in .NET you can being the SQL transaction handling into the code (i.e. C#) if that is available to you you could use this to wrap up everything.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

anyone have script or procedures to install SQL Server 2008 Express, set up the
Basically I want to have our installer also install the .NET framework and any
I have a Sql Server 2005 Standard production database with some <120 tables and
I have a WSI installer package that I'm using to install my application. The
I have just installed VMWare Server 2.0 on a fresh Fedora Core 8 install.
I have Python 2.6 and I want to install easy _ install module. The
I don't want to have the user install Google Gears so I can show
We use SQL Server 2000/2005 and Vault or SVN on most of our projects.
I have created a SQL DB-based winforms application, and I want to deploy it
I have a wix installer that will install an XML file and then modify

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.