Using Query Tools (SQL Server Compact)

The query tool used by SQL Server Compact is dependent on the Visual Studio version:

  • Use Transact-SQL Editor in Visual Studio 2010

  • Use Server Explorer or Query Designer in Visual Studio 2005 and later

Transact-SQL Editor, Server Explorer, and Query Designer can be used to do the following:

  • Upgrade SQL Server Compact 3.5 files to SQL Server Compact 4.0.

  • Create databases.

  • Create, modify, and delete tables and indexes in a database.

  • Add new columns, and delete or change the properties of existing columns, query objects by using the supported SQL statement.

  • Insert and delete rows in a table.

  • Modify existing data in a table.

  • Create or modify primary key and foreign key relationships between tables.

  • Encrypt an unencrypted database. If an unencrypted database is encrypted in the Server Explorer, the database is encrypted by using the Encryption Mode as platform default.

  • Change the password of an encrypted database.

  • Compact and repair a database.

Transact-SQL Editor

The Transact-SQL Editor is supported for SQL Server Compact databases beginning with Visual Studio 2010. Earlier versions of Visual Studio do not provide support for using the Transact-SQL Editor on SQL Server Compact databases. Visual Studio 2010 does not provide support for using the Transact-SQL Editor on databases created with earlier versions of SQL Server Compact.

Transact-SQL Editor in Visual Studio 2010 provides the ability to run free-text Transact-SQL queries against a SQL Server Compact database. The Transact-SQL Editor also provides the ability to view and save detailed estimated and actual query show-plans for SQL Server Compact databases.

In This Section

Topic

Description

Visual Studio Transact-SQL Editor

Provides more information about Visual Studio Transact-SQL Explorer.