Listing command history

In an isql session, use the h command to display the command history. A page can display up to 24 lines of commands. If the command history contains more than 24 lines, press Enter to display the next set of commands or enter “a” to display all commands in one page. Enter “q” to return to isql.

Syntax

h [n]

Parameter

n – indicates the number of commands to appear. If n is positive, the commands that appear start from the oldest command in the history. If n is negative, the n most recent commands appear.

Examples

Example 1 Lists all the commands stored in the command history:

1> h
[1] select @@version
[2] select db_name()
[3] select @@servername
1>

Example 2 Lists the two most recent commands issued:

1> h -2
[2] select db_name()
[3] select @@servername
1>