How to attach a database using SQL Server Management Studio

How to attach a database to SQL Server 

Procedure Steps

1) Open Microsoft SQL Server Management Studio.
 
2) In the left pane, right-click on Databases and select Attach.

3) In the Databases to attach section, click [Add].

4) Browse to the location of your data file (the default location is: C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data) and select AccessControl_DATA.MDF. Click [OK].

5) Click [OK] to attach the database.

6) Go back to the Object Explorer in Microsoft SQL Server Management Studio.

7) Expand Security, right-click on Logins, and then select New Login.

8) The Login window opens. In the left pane, select User Mapping and select the AccessControl check box and the master check box, nothing else needs to be selected. Click [OK].

9) In the Object Explorer pane expand Security, right-click on Logins and then select New Login.

10) The Login window opens. Select General and in the Login name field type Lenel.

11) Select SQL Server authentication and then type the desired password in the Password and Confirm password fields.

12) Verify that the only check box selected is Enforce password policy. (Make sure the Enforce password expiration and User must change password at next login check boxes are cleared.)

13) Verify that the Default database drop-down is set to master.

14) Verify that the correct language is set in the Default language drop-down and then click [OK]. (The default is English.)

15) Go back to the Object Explorer in Microsoft SQL Server Management Studio. Expand Databases, right-click on AccessControl, and then select New Query.

16) Type sp_dropuser lenel and press F5 to execute the command.

17) Type sp_changedbowner lenel and press F5 to execute the command.

Applies To

SQL Server all versions

Additional Information

Lenel recommends using a strong database password in step 11 of this article. For more information on strong password guidelines, refer to http://www.microsoft.com to search for recommendations.