Re: How to transactionally update a DB Schema?

From: Dan Guzman (danguzman_at_nospam-earthlink.net)
Date: 04/08/04


Date: Thu, 8 Apr 2004 08:57:38 -0500

You can execute DDL as part of an explicit transaction so that you can
rollback in the case of an error. However , I personally would backup the
database prior the upgrade and restore if an error is encountered.

-- 
Hope this helps.
Dan Guzman
SQL Server MVP
"Matthew Belk" <mbelk@bizspeed.com> wrote in message
news:uqNW53WHEHA.3564@TK2MSFTNGP09.phx.gbl...
> I am trying to build a database schema updater (in C#) that can be used to
> upgrade the various databases associated with my company's productized and
> custom applications.
>
> I've come up with what I think is an effective way of storing, specifying,
> and executing the required T-SQL scripts to change the database from one
> schema version to a new one, but I am having trouble reconciling how to
deal
> with potential errors while upgrading.
>
> Is there a way to transactionally perform various "CREATE/ALTER
> TABLE/PROCEDURE/TRIGGER/VIEW" and "INSERT/UPDATE/DELETE" statements so
that
> if one fails that I can rollback to before the upgrade started?  If SQL
> Server doesn't provide this functionality, what would be a "best practice"
> to handle these types of errors?
>
> Thanks,
> Matthew Belk
> BizSpeed, Inc.
>
>


Relevant Pages

  • Visual C++ 6.0 - Article!!!!!!!
    ... as the Enterprise Edition installer ... Studio 97 process. ... Don't let source safe 6.0 upgrade a shared database until everyone ...
    (microsoft.public.vc.mfc)
  • Re: add field to back-end existing table
    ... The ideal scenario is that all users have shortcuts to a Front-End Database ... of the program and its purpose: "Ticket Control Database version 5 Upgrade" ... Dim dbname as string 'Ticket Control Pathfilename ... Sub OpenAndLockDatabase() ...
    (microsoft.public.access.tablesdbdesign)
  • Re: SQL CE 3 and CF 1.0 support
    ... > We have designed our application so that all data access logic is ... > using our automated upgrade mechanism and at the same time upgrade the ... > from the engine download and the database upgrade delay). ... > I also know of applications that have been using SQL CE databases in RAM ...
    (microsoft.public.sqlserver.ce)
  • Re: Dell Axim V51 and WM5
    ... "Clinton Fitch, Clinton Fitch Com!" ... | Speaking of upgrades, HP is not offering an upgrade on the 2210. ... | how a database application would work. ... |> Will database apps run much slower on the Dell? ...
    (microsoft.public.pocketpc)
  • Re: Sharepoint - where are the files?
    ... it would seem silly to get 2003 at this time - just to upgrade yet ... You can use the Lists without http urls. ... I understand about the database part, and it's *probably* okay to have ... Opens it via SharePoint, makes some changes, ...
    (microsoft.public.windows.server.sbs)