SQL Packager





0/5 (0 vote)
Aug 4, 2004
5 min read

38193
SQL Packager packages up the schema and contents of Microsoft SQL Server databases so that installing a database is much simpler.
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.
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.
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.
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.
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.
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.
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.
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.