Generate upgrade script at install-time

Packages and compresses schema and contents of SQL Server databases

Moderators: JonathanWatts, Chris Auckland, David Atkinson, david connell, Anu Deshpande, Michelle Taylor, james.billings, Marianne

Generate upgrade script at install-time

Postby j » Thu Mar 12, 2009 6:26 pm

Hi there,

I'm interested in using a product that allows me to specify a target schema (and minimum data requirements) as part of an installation.

At install time, if the database doesn't exist, it is created. I have figured out how redgate takes us that far.

BUT, If the database ALREADY exists, I'd like the installer to create a custom change script right then, specific to that existing database, for the changes necessary to ensure that the target schema is as it ought to be.

The installer should attempt to build the change script, show any warnings of incompatible constraints, data loss, etc.

As a bonus, the installer might be tolerant of additional schema objects present in the existing database and leave them be (optionally), as long as the objects don't conflict with the target schema and minimum data.

SQL Packager seems to have all of the necessary technology to do this, but I haven't found it as an option.

Is it possible with redgate tools? Is there a very good technical reason why it can't/shouldn't be done this way?

Thanks,

J
j
 
Posts: 5
Joined: Thu Mar 12, 2009 6:14 pm

Postby simon.jackson » Fri Mar 13, 2009 10:50 am

Thanks for your interest. We are aware that this is a limitation of SQL Packager, and it may be something we look at in the future. It might be worth pointing out that if you know the state of the remote database you can use Packager to create an upgrade script, but this is obviously not always appropriate.

It is, however, currently possible to solve this problem using Red Gate technology, if you're prepared to get your hands dirty and write some C#, VB or other .NET code. The relevant product is the SQL Comparison SDK, which gives you full API access to Red Gate comparison tools.

In particular if you look at the Compare API samples "LoadAndSaveASnapshot" and "SynchronizeDatabases" you should be able to ship a SQL Compare snapshot and use this to create an upgrade script at the customer site.

You can even leave additional objects in the target schema by unsetting the SessionSettings.IncludeRecordsInTwo option!

Hope that helps
simon.jackson
 
Posts: 45
Joined: Thu Jan 08, 2009 10:42 am

Postby j » Fri Mar 13, 2009 7:33 pm

Thank you for the response!

That is a very reasonable option. Which DLLs are redistributable under the SQL Compare license? How does licensing work for those distributed assemblies - is there an end user key distributed along with my software?

Thanks,

J
j
 
Posts: 5
Joined: Thu Mar 12, 2009 6:14 pm

Postby j » Fri Mar 13, 2009 7:40 pm

Nevermind, I found this information on your website. Thanks!
j
 
Posts: 5
Joined: Thu Mar 12, 2009 6:14 pm

:D

Postby luckystar09 » Thu Aug 20, 2009 11:05 am

Thanks for your posts. They are really very cool, very wonderful
script install
luckystar09
 
Posts: 1
Joined: Thu Aug 20, 2009 10:58 am


Return to SQL Packager 6

Who is online

Users browsing this forum: No registered users and 1 guest