Share via


Run On Dialog Box

Use this dialog box to choose a connection or reference on which to run an SQL script.

To access this dialog box, right-click a script in a database project in Solution Explorer, then choose Run On from the shortcut menu.

Note

The Run On shortcut menu is only available for SQL scripts within a database project.

The dialog box lists the current database references for the project and the associated connections available in Server Explorer. Each line describes one database reference or one connection. To choose a database on which to run the script, highlight the database and click OK. Optionally, you can execute a script directly in Solution Explorer by dragging it to the database reference.

If you choose the list item called "<temporary reference>," you can establish a database connection just for the duration of the script. After the script completes, this connection does not appear in the project's list of database references or in Server Explorer's list of database connections.

If you choose Add Reference, the Connection Properties dialog box appears.

Note

The dialog boxes and menu commands you see might differ from those described in Help depending on your active settings or edition. To change your settings, choose Import and Export Settings on the Tools menu. For more information, see Visual Studio Settings.

  • Add Reference Button
    Creates a new database reference and runs the script on the new database connection.

See Also

Tasks

How to: Run a Script on a Database Other than the Current Default