To create a read-only database user account for Microsoft SQL Server 2005
- Start Microsoft SQL Management Studio.
- In the Connect to Server window, in the Server name box, select the SQL Server 2005 computer on which the database is installed.
- In the Authentication box, click SQL Server Authentication.
- In the Login box, type a user name that has permissions to create new accounts.
- In the Password box, type the password for the user name.
- Click Connect.
- On the SQL Server Management Studio window, in the Object Explorer pane, right-click Security, and then click New > Login.
- In the Login-New dialog box, perform the following tasks in the order in which they appear:
- In the Select a page pane, click General.
- In the right pane, in the Login name box, type a logon name for the new user.
- Check SQL Server authentication, type a password for the user, and then confirm the password.
- Uncheck User must change password at next login.
- In the Default database box, select the database to be read by this user.
- In the Login-New dialog box, in the Select a page pane, click Server Roles.
- In the right pane, click public.
- In the Login-New dialog box, in the Select a page pane, click User Mapping.
- In the right pane, under Users mapped to this login, make sure that you have selected the database to read.
- Under Database role membership for the database, click db_datareader.This role gives the user read-only data access to the database. The role of public is always selected and cannot be cleared.
- Click OK.