Contents
 Overview of ISQL/w

 Starting a New Query

 Saving a Query

 Saving Query Results

 Printing Query Results

 Configuring ISQL/w

 Editing Queries and Query Results

 Searching and Replacing Text

 Removing a Query

 Executing a Query

 Using Graphical Showplan

 Using Graphical Statistics I/O

 Setting Query Options

 Searching and Replacing Text


Overview of ISQL/w

The ISQL/w utility provides a graphical way to query SQL Server, analyze the execution plan of a query, and view statistics information about an executed query. You can execute multiple queries simultaneously with ISQL/w.

Navigation in ISQL/w can be done using the menus, the keyboard, and the buttons illustrated below.

Use this button	To
	Open a new Query tab.
	Open a saved query.
	Save a query to a file.
	Set query options.
	Select between available queries.
	Remove an executed query/result set from the Queries box.
	Execute a query.
	Cancel the execution of a query.
	Turn NO EXEC (compile a query without executing it) on or off.
	Turn graphical Showplan on or off.
	Turn graphical Statistics I/O on or off.


 Starting a New Query

When you open ISQL/w and connect to a SQL Server, the Query tab is available for typing queries. Once you execute a query, you can start a new query. The queries you have executed are listed in the Queries box, and you can switch between the queries at any time.

To start a new query

Choose the New button (shown above).

Related Topics

Overview of ISQL/w

Saving a Query

Editing Queries and Query Results

Searching and Replacing Text

Removing a Query

Executing a Query


 Saving a Query

You can save a query to a file for later use. Before you save the query, be sure that the Query tab is active.

To save a query

1.	Type the query in the Query tab.

2.	From the File menu, choose Save As, or choose the Save button (shown above).

The Save File dialog box appears.

3.	Type a name for the file.

4. Choose OK.

Related Topics

Overview of ISQL/w

Starting a New Query

Saving Query Results

Printing Query Results

Editing Queries and Query Results

Searching and Replacing Text

Removing a Query

Executing a Query


 Saving Query Results

You can save the results from a query to a file. You can edit the text first, if necessary. Before you save query results, be sure that the Results tab is active.

To save query results

1.	Type the query in the Query tab.

2.	Choose the Execute button, or press ALT+X or CTRL+E.

The query results appear. Edit the information, if necessary.

3.	From the File menu, choose Save As, or choose the Save button (shown above).

The Save File dialog box appears.

4. Type a name for the File.

5.	Choose OK.

Related Topics

Overview of ISQL/w

Starting a New Query

Executing a Query

Searching and Replacing Text

Saving a Query

Printing Query Results

Editing Queries and Query Results


Printing Query Results

You can print query results. You can edit the information first, if necessary. Be sure the Results tab is active.

To print query results

1.	Type the query in the Query tab.

2.	Choose the Execute button, or press ALT+X or CTRL+E.

The query results appear. Edit the information, if necessary.

3.	From the File menu, choose Print.

Related Topics

Overview of ISQL/w

Starting a New Query

Saving a Query

Editing Queries and Query Results

Searching and Replacing Text

Removing a Query

Executing a Query


Configuring ISQL/w

You can change configuration options that set timeouts for login attempts and for retrieving query results. You can also set automatic ANSI to OEM character conversion and set how often the ISQL/w result scheduler is called.

To set ISQL/w configuration information

1.	From the File menu, choose Configure.

The Configure ISQL/w dialog box appears.

2.	To set application-related preferences, choose the Application tab and then set the appropriate preferences.

To reset all application-related preferences to their defaults, choose Defaults.

3.	To set connection-related preferences, choose the Connection tab and then set the appropriate preferences.

To reset all application-related preferences to their defaults, choose Defaults.

4.	Choose OK.


Editing Queries and Query Results

You can cut, copy, paste, and delete the text in the Query or query results tabs. You can also drag the Results, Showplan, and Statistics I/O tabs and drop them in the lower part of the ISQL/w window.

To edit the query or query results

1.	Type a query in the Query tab. Edit the query, if necessary.

2.	Choose the Execute button.

The query results appear.

3.	Place the insertion point in the Results tab and then, from the Edit menu, choose the appropriate editing task.

Related Topics

Overview of ISQL/w

Starting a New Query

Saving a Query

Saving Query Results

Searching and Replacing Text

Printing Query Results

Removing a Query

Executing a Query


 Removing a Query

If you no longer need a query that is listed in the Queries box, you can remove it. You can also clear the existing query from the Query tab by choosing Clear Window from the Query menu. The query you type will replace the previous query in the Queries box when you re-execute the query.

To remove a query and its results

1.	In the Queries box, select the query.

2.	From the Query menu, choose Remove. Or choose the Remove button (shown above).

Related Topics

Overview of ISQL/w

Starting a New Query

Saving a Query

Editing Queries and Query Results

Searching and Replacing Text

Executing a Query


Executing a Query

After you have typed a query in the Query tab, you can execute the query. Once you have executed the query, it is listed in the Queries box. To replace that query, you can type over it in the Query tab. Once you have started executing a query, you can start a new query by choosing File New or, selecting the New button.

To execute a query

1.	Type a query in the Query tab.

2.	Choose the Execute button, or press ALT+X or CTRL+E.

The query results appear.

Related Topics

Overview of ISQL/w

Starting a New Query

Saving a Query

Editing Queries and Query Results

Searching and Replacing Text

Removing a Query


 Using Graphical Showplan

Graphical Showplan shows the query execution plan for a query. You can generate the query plan without executing the query by choosing the No Execute option. You can also generate a textual execution plan of the query by setting Show Query Plan in the Query Options dialog box.

To use graphical showplan

1.	Type a query in the Query tab.

2. Choose the Showplan button (shown above).

To generate Showplan results without executing the query, choose the No Execute button.

3.	Choose the Execute button, or press ALT+X or CTRL+E.

4.	Select the Showplan tab.

Details About the Query Chart

Details About the Query Plan Steps

Related Topics

Overview of ISQL/w

Using Graphical Statistics I/O

Setting Query Options


Details About the Query Chart

The Query Plan chart shows the name of the table(s) used, the method used to access the table(s), and the join path between tables. SQL Server uses one of three methods to access the table(s):

Using the clustered index (indicated by a green border)

Using a specified index (indicated by a yellow border)

Using a table scan, in which no indexes are used and the table is scanned sequentially (indicated by a red border)


Details About the Query Plan Steps

The query plan steps contain three parts: the result number, the steps that indicate subprocesses that occur during the query execution, and the action. The steps indicate the path that the optimizer chose to most efficiently process the query. Multistep processes usually occur when data must first be gathered and then sorted in a worktable. The action indicates the processing occurring on the tables listed in the chart.

Action	Result
SELECT	The query will retrieve data from the tables listed.
SELECT (into worktable)	The query will retrieve data from the tables listed and put the data into a worktable for further processing.
INSERT	The query is inserting data into the listed tables.
DELETE	The query is deleting data from the listed tables.
UPDATE	The query is updating data in the listed tables.
/Sorting	The query will sort the data in the listed tables.


 Using Graphical Statistics I/O

Graphical Statistics I/O depicts the amount of disk I/O required to access data for a query. You must execute the query in order to get Statistics I/O information, so the No Execute option must be turned off. You can also generate a textual description of the Statistics I/O by choosing Show Stats I/O in the Query Options dialog box. There are three I/O statistics: Scan Count, Logical Reads, and Physical Reads.

To use graphical Statistics I/O

1.	Type a query in the Query tab.

2.	Choose the Statistics I/O button.

3.	Choose the Execute button, or press ALT+X or CTRL+E.

4.	Select the Statistics I/O tab.

Related Topics

Overview of ISQL/w

Using Graphical Showplan

Setting Query Options


Scan Count

Indicates the number of times the query engine "visited" the table during the process of retrieving the data. Generally, for single table queries, the table is scanned once. For "lookup tables" (tables that are joined during processing in order to get more information), the scan count indicates the number of times the table was accessed.


Logical Reads

Indicates the number of index and data pages that were required to get the data needed for the query. This is not equal to the number of rows retrieved for a table, because a page of data can contain many rows.


Physical Reads

Indicates the number of logical reads that actually resulted in data access on the disk. The difference between logical and physical reads indicates the amount of data that was cached. Tables and worktables can appear multiple times in order to process all the data required for the query.


Searching and Replacing Text

You can search for text in the Query or Results tab. You can also repeat the last search you made and you can search and replace text.

To search for text

1.	Select the appropriate tab.

2.	From the Edit menu, choose Find.

The Find dialog box appears.

3.	Type the text to find, select whether to match case, and choose a search direction.

4.	Choose Find Next.

To repeat the last search

1.	Select the appropriate tab.

2.	From the Edit menu, choose Repeat Last Find, or press F3.

To replace text

1.	Select the appropriate tab.

2.	From the Edit menu, choose Replace.

The Replace dialog box appears.

3.	Type the text to find and the text to replace it with. Then select whether to match case and choose a search direction.

4.	Choose Find Next.

To replace the found text, choose Replace. To replace all specified text without prompting, choose Replace All.

Related Topics

Overview of ISQL/w

Saving a Query

Editing Queries and Query Results

Removing a Query

Executing a Query


 Setting Query Options

You can set options for how a query is processed each time you execute the query.

To set query options

1.	From the Query menu, choose Set Options, or choose the Options button (shown above).

The Query Options dialog box appears.

2.	In the Query Flags tab, Under Query Options, select the appropriate options.

3.	Under Limits, in the Row Count box, type the number of rows the server should return before ending a query.

The default (0) returns all rows.

4.	Select the Format Options tab.

5.	In the Result Output Format box, select the format for results.

If you choose Other Delimiter, in the Delimiter box, specify the delimiter.

If you choose Column aligned, to right-align numeric output, select the Right Align Numerics check box.

6. To display the PRINT statements output in the Results tab, select the Verbose Prints box.

This option is only useful if you are executing graphical Statistics I/O and/or Showplan.

7. If you do not want column headers to appear in the query results, clear the Print Headers check box.

8. To display the first three lines of the query in the Results tab, select Output Query.

9. Choose OK.

Related Topics

Overview of ISQL/w

Configuring ISQL/w

Using Graphical Showplan

Using Graphical Statistics I/O


To log in to a SQL Server

1.	In the Server box, select or type the name of a server.

The Server box contains a list of the last 5 servers logged in to. To get a list of servers on the network, choose the List Servers button.

2.	In the Login ID box, type your login identification.

If you selected one of the servers listed in the Server box, the last login ID you used to log in to that server is automatically supplied.

3.	In the Password box, type your password.

4.	Choose the Connect button.


Password

A confidential word the user supplies to gain access to a SQL Server. Because a password is confidential, it does not appear on the screen when typed. With integrated security for Windows NT, you do not need to provide a password.


Login ID

The unique name a user uses when logging in to a SQL Server. With integrated security for Windows NT, you do not need to provide a login ID.


Configure ISQL/w Dialog Box

Application Tab

Connection Tab


Application Tab

Edit Controls

Specifies information about buffer operations and fonts.

Undo Buffer Operations

Type the number of text actions to store in the buffer. ISQL/w keeps a record of text actions in the Query window, such as typing, deleting, or pasting text. These actions can be reversed by typing CTRL+Z, or from the Edit menu, choosing Undo in the Query or Result tab. You can keep a record of from 2 to 32,000 text actions, but be aware that the text is actually stored in memory--the larger the number, the more memory used. The default number of text actions stored is 20.

Font

Displays the Font dialog box. Use this dialog box to change the font in which the Query window displays queries and results.

Undo Buffer Limit Handling

Allows you to choose how to handle the data in the undo buffer during a large paste or delete.

Display Message Boxes

Displays a message box before the action takes place.

Default To Save

Saves the operation in the buffer.

Default to Discard

Will not remember the operation about to be done and discards all previous undo operations.

File Extensions

Specifies the default file extensions used when saving queries and results.

Query

Type the file extension for queries. The default is .SQL.

Results

Type the file extension for results. The default is .RPT.

Prompt On Closure

Prompts you before you close the Query window.

Switch To Result Tab On Execute

Automatically displays the Result tab when a query is executed.

Defaults

Sets all options to their default values.


Connection Tab

Timeouts (Seconds)

Specifies the login and query timeouts

Login Timeout

Type the amount of time, in seconds, that the server should wait before terminating a login attempt.

Query Timeout

Type the amount of time, in seconds, to wait when retrieving query results. If you exceed the timeout, you will be prompted to wait for another period.

ANSI -> OEM

Activates the automatic ANSI-to-OEM conversion.

Disconnect After Exec

Disconnects the Query Analyzer server connection after each query.

Defaults

Sets all options to their default values.


ANSI to OEM conversion

The AutoANSItoOEM entry controls the default conversion behavior when you connect to a server. If AutoANSItoOEM is set to ON, conversion is turned on in the following cases:

 ANSI clients to OEM servers (Windows and Windows NT)

 OEM clients to ANSI servers (Windows NT)

The Automatic ANSI to OEM option enables DB-Library to convert characters from OEM to ANSI when communicating with SQL Server, and from ANSI to OEM when communicating from SQL Server to the client. By default, this option is set on.

For Windows-based clients, the SQL Client Configuration Utility includes the Automatic ANSI to OEM option. By default, the setting for the Automatic ANSI to OEM option is set off.


Query Flags Tab

Select	To
Abort on Arithmetic Error	End a query when an overflow or divide-by-zero error occurs during a query. You cannot set both Abort on Arithmetic Error and Ignore Arithmetic Error.
Ignore Arithmetic Error	Return NULL when an overflow or divide-by-zero error occurs during a query. You cannot set both Abort on Arithmetic Error and Ignore Arithmetic Error.
No Count Display	Turn off the message returned at the end of each query result that tells how many rows were affected by the query statement.
No Execute	Compile a query but not execute it.
Parse Query Only	Check the syntax of each query and return any error messages without executing the query.
Show Query Plan	Generate a text description of the processing plan for the query as the query is processed. (To generate a graphical description of the processing plan, select the Showplan button on the Query window toolbar. If both the Showplan check box and button are selected, both a text and graphic description of the processing plan are generated.)
Show Stats Time	Display the time it took to parse and compile each query statement and the time it takes to execute each step of the query statement.
Show Stats I/O	Display the number of scans, logical reads, and physical reads for each table referenced in a query statement. (To generate a graphical description of the processing plan, select the Statistics I/O button on the Query window toolbar. If both the Statistics I/O button and check box are selected, both a text and graphical description are generated.)
Row Count	Type the number of rows the server should return before ending a query. The default (0) returns all rows.
Format Options Tab

 In the Result Output Format box, select the type of format to display the results in. The choices are Column Aligned, Comma Separated (CSV), Tab Delimited, and Other Delimiter. If you select Other Delimiter, in the Delimiter box type the delimiter. The default is Column Aligned.

 Select the Right Align Numerics check box to right-align numeric values in the query results for column aligned result output.

 Select the Verbose Prints check box to display the PRINT statements output in the results window. This option is useful if you are executing the graphical Showplan and/or Statistics I/O.

 Clear the Print Headers check box if you do not want column headers to appear in the query results.

 Select the Output Query check box to display the first three lines of a query with the query results.


ISQL/w Keyboard Help

Choose from the following list to get information about the keys used in ISQL/w:

Cursor Movement Keys

Dialog Box Keys

Menu Keys

Editing Keys

Help Keys

System Keys

Text Selection Keys

Windows Keys

ISQL/w Keys


Editing Keys

Use the following keys to edit text:

Key(s)	Function
BACKSPACE	Deletes the character to the left of the insertion point, or deletes the selected text.
DEL	Deletes the character to the right of the insertion point, or deletes the selected text.
SHIFT+DEL	Deletes the selected text and places it on the Clipboard.
SHIFT+INS	Inserts text from the Clipboard to the active window.
CTRL+INS	Makes a copy of the selected text and places it on the Clipboard.


Help Keys

Use the following keys to get Help information:

Key	Function
F1	Within a dialog box, pressing F1 displays the dialog box Help information. If the Help window is already open, pressing F1 displays information about how to use Help.
SHIFT+F1	Within the Query window, if you select Transact-SQL syntax and press SHIFT+F1, help on the Transact-SQL statement is displayed.
ALT+F1	Displays object help (sp_help) for the selected object.


System Keys

The following keys can be used from any window:

Key(s)	Function
CTRL+ESC	Switches to the Task List.
ALT+ESC	Switches to the next application or minimized icon, including full-screen programs.
ALT+TAB	Cycles through running applications.
PRTSC	Copies an image of the entire screen contents onto the Clipboard.
ALT+PRTSC	Copies an image of the ISQL/w window onto the Clipboard.
ALT+F4	Closes the application.
CTRL+F4	Closes the active window.


Dialog Box Keys

Use the following keys within dialog boxes:

Key(s)	Function
TAB	Moves from option to option (left to right and top to bottom).
SHIFT+TAB	Moves from option to option in reverse order.
ALT+letter	Moves to the option or group whose underlined letter matches the one you press.
Arrow keys	Moves the selection cursor from option to option within a group of options. Or moves the cursor left, right, up, or down within a list or text box.
HOME	Moves to the first item or character in a list or text box.
END	Moves to the last item or character in a list or text box.
PAGE UP or  PAGE DOWN	Scrolls up or down in a list box, one window at a time.
ALT+Up or Down arrow	Opens a drop-down list box and selects an item within a drop-down list box.
SPACEBAR	Selects or clears a check box.
SHIFT+Arrow key	Selects text in a text box.
SHIFT+HOME	Selects text from the cursor point to the first character in a text box.
SHIFT+END	Selects text from the cursor point to the last character in a text box.
ENTER	Executes a command button, or chooses the selected item in a list box and executes the command.
ESC or ALT+F4	Closes a dialog box without completing the command (same as the Cancel button).


Cursor Movement Keys

Use the following keys to move the insertion point in the Query window and other places where you can type text:

Key(s)	Moves the insertion point
Up arrow	Up one line.
Down arrow	Down one line.
Right arrow	Right one character.
Left arrow	Left one character.
CTRL+Right arrow	Right one word.
CTRL+Left arrow	Left one word.
HOME	To the beginning of the line.
END	To the end of the line.
PAGE UP	Up one window.
PAGE DOWN	Down one window.
CTRL+HOME	To the beginning of the window or text area.
CTRL+END	To the end of the window or text area.


Text Selection Keys

Use the following keys to select text:

Key(s)	Function
SHIFT+Left or Right arrow	Selects text one character at a time to the left or right, or, if the character is already selected, cancels the selection.
SHIFT+Down or Up arrow	Selects one line of text up or down, or, if the line is already selected, cancels the selection.
SHIFT+PAGE UP	Selects text up one window, or, if the previous window is already selected, cancels the selection.
SHIFT+PAGE DOWN	Selects text down one window, or, if the next window is already selected, cancels the selection.
SHIFT+HOME	Selects text to the beginning of the line.
SHIFT+END	Selects text to the end of the line.
CTRL+SHIFT+ Left arrow	Selects the previous word.
CTRL+SHIFT+ Right arrow	Selects the next word.
CTRL+SHIFT+HOME	Selects text to the beginning of the document.
CTRL+SHIFT+END	Selects text to the end of the document.


Menu Keys

Use the following keys to select menus and choose commands:

Key(s)	Function
ALT or F10	Selects the leftmost menu on the menu bar.
ALT+letter	Chooses the menu or menu item whose underlined letter matches the one you press.
Left or Right arrow	Moves among menus.
Up or Down arrow	Moves among menu items.
ENTER	Chooses the selected menu item.
ESC	Cancels the selected menu.


Window Keys
Windows Keys

Use the following keys to navigate in the Microsoft Windows or Windows NT operating systems:

Key(s)	Function
ALT+SPACEBAR	Opens the System menu for an application.
ALT+-(Hyphen)	Opens the System menu for a document window.
ALT+F4	Closes an application.
ALT+ESC	Switches to the next application or minimized icon, including full-screen programs.
ALT+TAB	Cycles through running applications.
ALT+ENTER	Switches an application for an operating system other than Windows between running in a window and running full screen.
Direction keys	Moves a window when you have chosen Move from the System menu, or changes the size of a window when you have chosen Size from the System menu.


ISQL/w Keys
ISQL/w

The following keys are specific to ISQL/w:

Key(s)	Function
CTRL+N	Opens a new query window.
CTRL+O	Displays the Connect Server dialog box.
CTRL+E or ALT+X	Executes a query.
CTRL+Z	Reverses the last action. (You can reverse up to 20 actions by default. You can change this number in the Configure ISQL/w dialog box.)
CTRL+C	Cancels the query.
F1	Displays Transact-SQL Help information for the selected syntax.
ALT+F1	Displays Help (sp_help) information for the selected object.
F6	Moves right between the tabs.
SHIFT+F6	Moves left between the tabs.
CTRL+Up Arrow and CTRL+Down Arrow	Toggles between result sets.
CTRL+Delete	Clears the Query window.
ALT+Delete	Removes the current query/result set.