Share via


The SQL Server Compact 3.5 Database Upgrade tool lets you upgrade a SQL Server Compact 1.0 or 2.0 database so that it can be used with SQL Server Compact 3.5. This command-line tool must run on the smart device, and both the source and destination databases must be located on the device.

Before a version 1.0 or 2.0 database file can be upgraded to SQL Server Compact 3.5, both runtime .msi files must be installed on the mobile device. For example, to upgrade a SQL Server 2000 Windows CE Edition (version 2.0) database file to SQL Server Compact 3.5, both SQL Server CE and SQL Server Compact 3.5 must be installed on the mobile device.

The database upgrade tool does not upgrade a SQL Server 2005 Compact Edition (version 3.1) database file (.sdf) to a SQL Server Compact 3.5 database file. To upgrade a SQL Server 2005 Compact Edition database, see Upgrading from Earlier Versions (SQL Server Compact).

To download and install the SQL Server Compact 3.5 Database Upgrade tool

  1. The database upgrade tool is installed with Visual Studio 2008 as part of the SQL Server Compact 3.5 for Devices .msi (SSCEDeviceRuntime-ENU.msi). The default location of the file is <drive>:\Program Files\Microsoft  SQL Server Compact Edition\v3.5\Devices\[platform]\[processor]\upgrade.exe.

  2. Using ActiveSync, copy the Upgrade.exe file to the My Device folder on the smart device.

To open a command line on the smart device

  1. Press and hold the Action or Enter button on the device.

  2. While pressing the Action or Enter button, tap and hold the clock icon in the top menu bar.

  3. Release the Action or Enter button. A menu with two options (Run and Clock) is displayed.

  4. Click Run. The command Prompt window is displayed.

    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.

To run the upgrade tool

  1. In the Open box of the command Prompt window, type the command to upgrade the database. The upgrade tool uses the following syntax.

    upgrade.exe /s "\dir1\source.sdf" /sp "<enterStrongPassword1Here>" /d    "\dir2\destination.sdf" /dp “<enterStrongPassword2Here>" /e /q
    

    For more information about the parameters that are used with Upgrade.exe, see the table later in this topic.

  2. When the upgrade is completed, a message box displays the results, success, or failure.

Example

This example shows how to convert a database named MyDb1.sdf to a SQL Server Compact 3.5 database named MyUpgradesDB.sdf. The resulting database is encrypted and password-protected.

upgrade.exe /s "\DB\MyDb1.sdf" /sp "<enterStrongPassword1Here>" /d 
   "\DB\MyUpgradedDB.sdf" /dp “<enterStrongPassword2Here>" /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)

Concepts

Upgrading from Earlier Versions (SQL Server Compact)