Navigating the Query Window
When you start SQL Server 2005 Compact Edition (SQL Server Compact Edition) Query Analyzer, the query window contains the following tabs: Objects, SQL, Grid, and Notes.
Objects tab
Use the Objects tab to manage databases and database connections, and explore, add, and drop database objects. When you connect to a database, you can view, add, and drop:
- Tables
- Table columns
- Indexes
- System tables (view only)
To perform these functions, use the buttons located either at the bottom of the screen on a Pocket PC device, or the top of the screen on a Handheld PC device. The availability of the buttons depends on the node that is selected in the database tree. For example, when you select a table, buttons are available for executing a SELECT * FROM table_name
statement, adding a column to the table, creating an index on the table, and dropping the table. The following illustration shows SQL Server Compact Edition Query Analyzer as it appears on a Pocket PC device.
The buttons labeled in the illustration perform the following functions:
A. Tap to execute a SELECT * FROM Employees
statement.
B. Tap to add a column to the selected table.
C. Tap to create an index on the selected table.
D. Tap to drop the selected table.
SQL tab
Is a command-line editor, which you can use to do the following:
- Type and execute SQL statements.
- Manage SQL Server Compact Edition script files.
- Save SQL statements directly in SQL Server Compact Edition Query Analyzer for editing and reuse.
Grid tab
Shows the results set of a query.
Notes tab
Displays messages after a command has been executed from either the Objects tab or the SQL tab. If a query executes successfully, a message provides information about the elapsed time and rows affected, if any. If a command causes an error or a query itself contains an error or unsupported SQL elements, a message provides error information. This includes the failed query and a short description. The Notes tab contains a Copy button for selecting text and pasting to the SQL tab or a text editor. For information about errors, see Troubleshooting (SQL Server Compact Edition).
The Tools Menu
The Tools menu is available in all four panes and contains the following items:
Refresh
Updates the view of the database tree on the Objects tab after any changes are made to the database.
Logging
When selected, logs corresponding SQL statements on the SQL tab when commands are executed on the Objects tab. Logged statements are not saved automatically. For more information about saving logged statements, see Executing SQL Statements on the SQL Tab.
Fonts
Changes the font settings of text on all four tabs.
About
Provides version information about SQL Server Compact Edition and SQL Server Compact Edition Query Analyzer.
Exit
Exits SQL Server Compact Edition Query Analyzer.
Note
If you exit SQL Server Compact Edition Query Analyzer without closing a database connection, when you restart SQL Server Compact Edition Query Analyzer, the Objects tab shows the last database connection and the last view.
The SQL Menu
The SQL menu is available only on the SQL tab. For more information about the SQL menu, see Executing SQL Statements on the SQL Tab.