您的位置:首页 > 数据库

How to: Use the Database Upgrade Tool (SQL Server Compact Edition)

2007-07-09 13:37 549 查看
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
The database upgrade tool is installed with Visual Studio 2005 as part of SqlMobile30DevTools[lang].msi file. The default location of the file is <drive>:\Program Files\Microsoft Visual Studio 8\SmartDevices\SDK\SQL Server\Mobile\v3.0\[platform]\[processor]\upgrade.exe.

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
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.



To run the upgrade tool
In the Open text box of the command prompt window, type the command to upgrade your database. The upgrade tool uses the following syntax:

Copy Code
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.



Example


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


Copy Code
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).


See Also


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)
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐