Use the ? command to recall and reissue a command from the command history.
? n | ??
n – when n is positive, isql looks for the command labeled with the number n and loads this to the command buffer. When n is negative, isql loads the nth most recent command issued.
?? – recalls the latest command issued and is equivalent to ? -1.
In this sample command history used for examples 1 and 2, [1]
tags
the oldest command issued and [3]
tags
the most recent command issued:
[1] select @@version [2] select db_name [3] select @@servername
Example 1 Recalls the command labeled 1 from the command history:
1> ? 1
1> select @@version 2>
Example 2 Recalls the latest issued command from the command history:
1> ? -1
1> select @@servername 2>
When a command is recalled from history, the recalled command overwrites the command in the command buffer.
You can edit a recalled command before resubmitting the command to the server.