How to: Use the Database Upgrade Tool (SQL Server Compact Edition)
The Microsoft SQL Server 2005 Compact Edition (SQL Server Compact Edition) Database Upgrade tool lets you upgrade a SQL Server Compact Edition 1.0 or 2.0 database to work with SQL Server 2005 Compact Edition. This command-line tool must run on the smart device, and both the source and destination databases must be located on the device.
To download and install the SQL Server Compact Edition Database Upgrade tool
To open a command line on the smart device
-
To open the command prompt window on a Pocket PC device, press and hold the action or enter button on the device.
-
While pressing the action or enter button, tap and hold the clock icon in the top menu bar.
-
Release the action or enter button. A menu with two options (Run and Clock) is displayed.
-
Click Run. The command prompt window is displayed.
It is important to note that this method of opening a command line might not work on all smart devices. For Pocket PC 2003 devices, you can install Windows Mobile Developer Power Toys, which includes the PPC Command Shell.
-
In the Open text box of the command prompt window, type the command to upgrade your database. The upgrade tool uses the following syntax:
upgrade.exe /s "\dir1\source.sdf" /sp "password1" /d "\dir2\destination.sdf" /dp “password2" /e /q
For more information about the parameters used with upgrade.exe, see the table later in this topic.
-
When the upgrade is completed, a message box displays the results, success or failure.
upgrade.exe /s "\DB\MyDb1.sdf" /sp "P@ssw0rd" /d "\DB\MyUpgradedDB.sdf" /dp “P@ssw0rd2" /e
The following table lists the parameters that you can use with the Database Upgrade tool.
Parameter
Description
/s
The path of the source database file (required).
/sp
The password for the source database file (optional).
/d
The path of the destination database file. If you specify an existing file, the file will be overwritten (required).
/dp
The password for the destination database file (optional).
/e
If specified, the destination database will be encrypted. If you specify the /e parameter, you must also specify /sp and provide a password (optional).
/q
Perform the upgrade silently without any UI (optional).
/?
Displays this list of parameters (optional).
Reference
Database Upgrade Tool (SQL Server Compact Edition)
Concepts
Upgrading SQL Server Mobile and SQL Server CE
Help and Information
Getting SQL Server Compact Edition Assistance
Source: How to: Use the Database Upgrade Tool (SQL Server Compact Edition)