Saturday, February 14, 2009

Create accounts and assign rights to access SQL

Below is a summary of steps to create account and assign rights to access database (more than 1 database) of SQL Server 2005.

1. Execute commands as below to create login account
CREATE LOGIN deve1
WITH PASSWORD = 'deve1';
USE name_of_dbase1;
CREATE USER deve1 FOR LOGIN deve1;
GO

2. Execute commands as below to assign user account to each database
use name_of_dbase2
exec sp_adduser deve1

use name_of_dbase3

exec sp_adduser deve1

3. Right click name of database, select permission and click to select options as below:

No comments: