This documentation is archived and is not being maintained.

How to: Connect to Different Databases in the Same Editor Session

In the Transact-SQL editor, you can connect to a different database on the same server without closing your editing session. For example, you do not need to manually disconnect from a server and then reconnect to it every time that you query a different database on the same server.

To complete this procedure, you must have an active session of the T-SQL editor with a connection to a database server.

To connect to a different database in the same editor session

  • On the T-SQL Editor toolbar, in the Database list, click the name of the database to which you want to connect.

    NoteNote

    You can also press CTRL+U to give focus to the Database list.

    When you click the database name, the editor connection is changed to use that database. The window name and the properties window both reflect the name of the database to which you are connected.

    NoteNote

    You can also specify a different database by including a USE DatabaseName statement in your script or query.

Security

The Database list shows only those databases to which you have permission to connect.

See Also

Show: