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

To navigate in ISQL/w, you can use the menus, the keyboard, and the following buttons:

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


 Starting a New Query

After you open ISQL/w and connect to a SQL Server, the Query tab appears in which you can type a query. After you execute a query, you can start a new query. The queries you execute are listed in the Queries box, and you can switch among the queries at any time.

To start a new query

From the Query Window, click the [image] New Query button. In the Query tab, type the query.

See Also

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 a query, verify that the Query tab is active.

To save a query

1.	From the Query window, in the Query tab type the query.

2.	From the File menu, choose Save As or click the [image] Save Query/Result button.

The Save File dialog box appears.

3.	In the File Name box, type a name for the file.

4.	Click OK.

See Also

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 query results to a file. You can also edit the results text before you save it. Before you save query results, verify that the Results tab is active.

To save query results

1.	From the Query Window, in the Query tab type the query.

2.	Click the [image] Execute Query 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 click the Save Query/Result button.

The Save File dialog box appears.

4.	In the File Name box, type a name for the file.

5.	Click OK.

See Also

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 also edit the results text before you print it. Before you print, verify that the Results tab is active.

To print query results

1.	In the Query Window, in the Query tab type the query.

2.	Click the [image] 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.

See Also

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 ISQL/w configuration options that set timeouts for login attempts and for query results retrieval. You can also specify 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 Microsoft ISQL/w window, from the File menu, choose Configure.

The Configure ISQL/w dialog box appears.

2.	To set application-related preferences, in the Application tab, set the appropriate preferences.

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

3.	To set connection-related preferences, in the Connection tab, set the appropriate preferences.

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

4.	Click OK.


Editing Queries and Query Results

You can cut, copy, paste, and delete the text in the Query and the Results tabs. You can also drag the Results 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.	From the Query window, in the Query tab type a query. Or click the [image] Load SQL Script button to open a saved query. Edit the query, if necessary.

2.	Click the Execute button.

The Results tab appears.

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

See Also

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

You can remove a query from the Queries box. You can also clear the existing query from the Query tab.

To remove a query and its results

From the Query Window, in the Queries box select the query to remove and click the [image] Remove Current Query button.

Or

In the Query tab, from the Query menu choose Clear Window. The query displayed in the Queries box will be replaced by the next query you execute.

See Also

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

You can execute the query displayed in the Query tab.

To execute a query

1.	From the Query window, in the Query tab type a query.

2.	Click the [image] Execute button, or press ALT+X or CTRL+E.

The query results appear.

See Also

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 Statistics I/O

Graphical Statistics I/O depicts the amount of disk input/output required to access data for a query. You must execute the query to generate Statistics I/O information; verify that the No Execute option is off.

You can also generate a textual description of the Statistics I/O. The I/O statistics are scan count, logical reads, and physical reads.

To use Graphical Statistics I/O

1.	From the Microsoft ISQL/w window, in the Query tab type a query.

2.	Click the [image] Display Statistics I/O button.

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

4.	Select the Statistics I/O tab.

Or

Before you execute a query, from the Query menu choose Statistics I/O.

To generate a textual description of the Statistics I/O

1.	From the Query window, click the [image] Query Options button.

The Query Options dialog box appears.

2.	In the Query Flags tab, select the Show Stats I/O option.

The textual description appears in the Results tab.

See Also

Overview of ISQL/w

Setting Query Options


Scan Count

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


Logical Reads

Indicates the number of index and data pages that were required to obtain necessary data 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 the textual description in the Results tab.


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 for and replace text.

To search for text

1.	Select the Query or Results 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.	Click Find Next.

Matching text is highlighted in the tab.

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.	In the Find What box, type the text to find.

4.	In the Replace With box, type the new text.

5.	Select whether to match the case and choose a search direction.

6.	Click Find Next.

Matching text is highlighted in the tab.

7.	To replace the found text with the text typed in the Replace With box, click Replace. To replace all specified text at once, click Replace All.

See Also

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.	In the Query window, from the Query menu, choose Set Options or click the [image] Query Options button.

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 select Other Delimiter, in the Delimiter box type the delimiter.

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

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

This option is only useful if you are executing Graphical Statistics I/O.

7.	To prevent column headers from appearing 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 the Output Query check box.

9.	Click OK.

See Also

Overview of ISQL/w

Configuring ISQL/w

Using Graphical Statistics I/O


Connect Server Dialog Box

Use this dialog box to connect to a SQL Server. You must connect to the server before you execute a query.

To connect to a SQL Server

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

The Server box contains a list of the previous five servers connected to. To access a list of servers on the network, click the List Servers button.

2.	In the Login Id box, type the server's login identification.

If you selected a server listed in the Server box, the login ID used previously is automatically supplied.

3.	In the Password box, type the password.

4.	Click the Connect button.


Password

Is 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

Is the unique name a user supplies when logging on to a SQL Server. With integrated security for Windows NT, you do not need to provide a login ID.


Configure ISQL/w Dialog Box

Use this dialog box to see preferences for ISQL/w. For more information, choose one of the following:

Application Tab

Edit Controls

Undo Buffer Limit Handling

File Extensions

Defaults

Prompt On Closure

Switch To Results Tab On Execute

Connection Tab

Timeouts (seconds)

ANSI->OEM

Disconnect After Exec

Packet Size

Defaults


Edit Controls

Specifies information about buffer operations and fonts.

Undo Buffer Operations

Specifies the number of text actions to store in the buffer. ISQL/w maintains 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, by choosing Undo while in the Query or Result tab. You can keep a record of 2 to 32,000 text actions, but note that the text is stored in memory--the larger the number of actions, the more memory used. The default number of text actions stored is 20.

Font

Displays the Font dialog box, in which you can change the font used in the Query window for queries and results.


Undo Buffer Limit Handling

Specifies 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

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

Results

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


Prompt On Closure

Specifies that a prompt be displayed before you close the Query window.


Switch To Result Tab On Execute

Specifies that the the Result tab will automatically display when a query is executed.


Defaults

Sets all options to their default values.


Timeouts (seconds)

Specifies the login and query timeouts

Login Timeout

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

Query Timeout

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


Packet Size

Specifies the network packet size for the ISQL/w connection to the server.


Defaults

Sets all options to their default values.


ANSI to OEM conversion

The automatic ANSI to OEM option controls the default conversion behavior when you connect to a server. If this option is selected, 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 on.

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


Query Options Dialog Box

Use this dialog box to set query preferences. For more information, choose one of the following:

Query Flags Tab

Query Options

Abort on Arithmetic Error

Ignore Arithmetic Error

No Count Display

No Execute

Parse Query Only

Show Query Plan

Show Stats Time

Show Stats I/O

Limits

Format Options Tab

Result Output

Verbose Prints

Print Headers

Output Query


Query Options

Specifies preferences for executing queries


Abort on Arithmetic Error

Specifies to end a query when an overflow or divide-by-zero error occurs during a query. You cannot select Abort on Arithmetic Error and Ignore Arithmetic Error check boxes at the same time.


Ignore Arithmetic Error

Specifies that NULL is returned when an overflow or divide-by-zero error occurs during a query. You cannot selected Abort on Arithmetic Error and Ignore Arithmetic Error check boxes at the same time.


No Count Display

Specifies that the message returned at the end of each query result that tells how many rows were affected by the query statement will not appear.


No Execute

Specifies that a query will be compiled but not executed.


Parse Query Only

Specifies that the syntax of each query will be checked and error messages will be returned without executing the query.


Show Query Plan

Specifies that a text description of the processing plan for the query will be generated as the query is processed.


Show Stats Time

Specifies that the time it took to parse and compile each query statement and to execute each step of the query statement will be displayed.


Show Stats I/O

Specifies that the number of scans, logical reads, and physical reads for each table referenced in a query statement will be displayed. To generate a graphical description of the processing plan, select the Statistics I/O button on the Query window toolbar. If the Statistics I/O button and the Show Stats I/O check box are selected, a text and a graphical description are generated.


Limits

Specifies the number of rows to return before ending a query. The default (0) returns all rows.

Row Count

Is the number of rows to return.


Result Output

Specifies format preferences for results output.

Result Output Format

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

Right Align Numerics

Specifies to right-align numeric values. Column Aligned must be displayed in the Result Output Format box for this check box to be enabled.


Verbose Prints

Specifies that PRINT statement output will be displayed in the Results window. This option is useful if you are executing Statistics I/O.


Print Headers

Specifes that column headers will appear in query results.


Output Query

Specifies that the first three lines of a query will be displayed in the query results.


ISQL/w Keyboard Help

Choose from the following for 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 pointer, or deletes the selected text.
DEL	Deletes the character to the right of the pointer, 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	Copies the selected text and places it on the Clipboard.


Help Keys

Use the following keys for Help information:

Key	Function
F1	Displays the dialog box Help information when pressed while in a dialog box. If the Help window is already open, pressing F1 displays information about how to use Help.
SHIFT+F1	Displays information about the Transact-SQL syntax selected in a Query window.
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 with the underlined letter that 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	Expands a list box and selects an item within a list box.
SPACEBAR	Selects or clears a check box.
SHIFT+Arrow key	Selects text in a text box.
SHIFT+HOME	Selects text from the pointer to the first character in a text box.
SHIFT+END	Selects text from the pointer 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 pointer 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 left-most menu on the menu bar.
ALT+letter	Chooses the menu or menu item with the underlined letter that 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.


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

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+SHIFT+Delete	Clears the Query window.
ALT+Delete	Removes the current query/result set.