Popular Posts

Wednesday, March 18, 2009

Connecting to SQL Server Database using Management Studio

As you learned in one of the previous chapters, SQL Management Studio can be used to manage multiple instances of SQL Server. However, when you open the Management Studio, it will prompt you to specify the login information to any one of the instances.

The below screenshot shows the login screen of SQL Management Studio 2005.





Server Type

The first dropdown in the above screenshot represents the "Server Type". Depending on the number of features you have installed, there will be various options here. When you are trying to connect to the database server, you have to choose "Database Engine".

Server Name

Second dropdown is to select the database server name. If you are connecting to the SQL Server installed on local computer, you can use one of the following (assuming DevServer1 as the computer name and 192.168.2.100 as IP Address):

(local)
. (dot)
localhost
127.0.0.1
DevServer1
192.168.2.100

The first 4 options are used to represent the local computer. If you are connecting to an SQL Server installed on a different computer, you can use only IP Address or Computer name.

If you are connecting to a named instance of SQL Server instead of the default instance, then you must append a backslash and instance name to the above mentioned names. Example: 192.168.2.100\SQLInstance2

Authentication

This dropdown gives two options:

1. Windows Authentication
2. SQL Server Authentication

If you select Windows Authentication, the login and password you used while logging in to your computer will be used to connect to the database server. If you are an administrator on the local computer or if you have configured the database server to use your windows account, you can use this option.

SQL Server Authentication can be used if you have created a user name and password in SQL Server. In that case, you must select this option and specify the user name and password below the drop down.

After specifying appropriate options above, you can press the "Connect" button to connect to the specified database server.

No comments:

Post a Comment