connect to database using SQL Query Analyzer

  • I would like to connect to a database using SQL Qry Analyser from the File, Connect menu in Sql Query Analyzer.

    When I type in the "SQL Server: serverName" on the "Connect to SQL server" utility menu, the connection does not register OR it connects to the Master database.

    Do I have to type in a database name as well? inorder to connect to a specific database.

    i.e

    serverName\DatabaseName?

    Please help.

  • >>Do I have to type in a database name as well? inorder to connect to a specific database.

    When you connect, you are automatically in the default database associated with your login on that particlaur SQL Instance

    You can either:

    - Change your login properties so that a database other than 'master' is your default (see sp_defaultdb )

    - add 'USE DatabaseName' as the first command in whatever SQL you're running

  • Thanks.

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply