Click here to Skip to main content
15,881,248 members
Articles / Programming Languages / SQL
Article

SQL Packager

3 Aug 20045 min read 37.9K   11  
SQL Packager packages up the schema and contents of Microsoft SQL Server databases so that installing a database is much simpler.

This article is in the Product Showcase section for our sponsors at CodeProject. These articles are intended to provide you with information on products and services that we consider useful and of value to developers.

This is a showcase review for our sponsors at CodeProject. These reviews are intended to provide you with information on products and services that we consider useful and of value to developers.

Package SQL Server databases

SQL Packager packages up the schema and contents of Microsoft SQL Server databases so that installing a database is much simpler. SQL Packager is used for:

  • Packaging a database structure for installation or deployment
  • Packaging database data for installation or deployment
  • Packaging both data and structure for installation or deployment
  • Updating existing databases by packaging up changes of data and structure

SQL Packager does this by creating a .NET executable that can recreate the database, or the update of the database, that you need on other machines.

Features and uses

  • Select the schema objects and/or data you wish to be packaged
  • Simple process to package the database
  • Useful for deploying, installing, moving, and updating database schema and data
  • A single wizard for defining the objects and data, and creating the package
  • C# code templates that can be modified to suit your desired look and feel
  • Databases are packaged as a .NET executable so they can be distributed to any machine running the .NET framework and Microsoft SQL Server

SQL Packager Walk-through

Once you've installed the SQL Packager, you will have a simple way of packaging your SQL Server databases either as an update or as a standalone. The following walk-through is a simple example demonstrating how SQL Packager will package a database. To fully understand SQL Packager, please try it out by downloading the 14-day, fully-functional, free trial.

Image 1

Screenshot 1. Choosing the database to be packaged

The first thing you need to do is select the database you wish to package. A database can be packaged across a network or VPN, if necessary.

If you are packaging a database update, you need to specify the database you are updating and the database you wish to migrate. In this case we are going to package an upgrade to an existing database, so we select the latest database, MusicShop2, on the left side of the wizard screen, and the previous version, MusicShop1, is selected on the right.

Image 2

Screenshot 2. Selecting objects to package

Next, you choose the objects you wish to package. If an update is being packaged, you will need to decide, on an object-by-object basis, what you want to do with each object. Use the check boxes to choose the objects to be packaged, and the action column describes what we are going to do with each object.

Image 3

Screenshot 3. Selecting data to package

Once you have decided which objects to package, you need to decide which selected objects you wish to include data for. This is again done using check boxes.

Once this has been done, you have specified the 'package'. Now it is time to review the SQL scripts for the objects and data, and to examine any potential problems that the Packager has predicted.

Image 4 Image 5

Screenshot 4a and b. Reviewing the change SQL

Using the tabs at the bottom of the wizard screen, you can see the SQL scripts for packaging the structure and data (separate screens, as shown in the screenshots above). These are the scripts that will be executed on the SQL Server to create the database. The scripts are formatted in the way usually seen in SQL Query Analyzer.

Image 6

Screenshot 5. Summary of changes

SQL Packager presents a list of the database changes under the "Summary" tab, so you can quickly see what is being done to you databases.

There are also options to configure scripts to your exact needs. These options can be found under the "Packager" menu.

Once the scripts and summary have been viewed you can move on to packaging up the database.

To package a database, you need to choose the type of package you wish to create. This can be a .NET executable or a C# project. Choosing to package a database as a C# project is useful if you need to customize the package – for example, you might want to give the package the same look and feel as your install program. In this case we've chosen to package our database as a .NET executable.

Image 7

Screenshot 6. Naming and saving your package

Finally, you need to name the package and tell SQL Packager where to save the file. You can also give any instructions relevant to the person deploying the database by clicking on the "Extra package info" button.

Image 8

Screenshot 7. Database properties

When detailing any extra information you can also set database properties by clicking on the "Database properties" tab (see screenshot 7). Clicking this tab will allow you to specify the name of the database to use when running the package to ensure the end user will create a database with the correct name. You can also specify the size of the database, which is particularly useful when you have a larger database as your package will take less time to run. Click "OK" to save the additional information and continue.

Create your package by clicking "Finish".

Once you have created a package, you can distribute it to your customers or end-users. They will be able to install hassle-free databases and database updates simply by launching the package. Alternatively, you could deploy your package as part of your own application's install program.

Evaluating SQL Packager

The above walk-through is a brief description of how SQL Packager will package a database. Visit Red Gate’s website to see a full walk-through.

To see how SQL Packager will work for you, download a fully-functional, free trial.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
Red Gate Software Ltd.
United Kingdom United Kingdom
Redgate makes ingeniously simple software used by 804,745 IT professionals and counting, and is the leading Microsoft SQL Server tools vendor. Our philosophy is to design highly usable, reliable tools which elegantly solve the problems developers and DBAs face every day, and help them adopt database DevOps. As a result, more than 100,000 companies use products in the Redgate SQL Toolbelt, including 91% of those in the Fortune 100.
This is a Organisation

1 members

Comments and Discussions

 
-- There are no messages in this forum --