Combining multiple statements

Interactive SQL allows you to enter multiple statements at the same time. End each statement with the Transact-SQL command, go.

  1. Enter multiple statements in the SQL Statements pane separated by go:

    update titles
    set price = 21.95
    where pub_id = "1389"
    go
    update titles
    set price = price + 2.05
    where pub_id = "0736"
    go
    update titles
    set price = price+2.0
    where pub_id = "0877"
    go
    
  2. On the toolbar, click the Execute SQL Statement button (or select F9). All three statements are executed. After execution, the commands remain in the SQL Statements pane. To clear this pane, press the Esc key.

    You can roll back your changes by entering rollback and executing the statement.