Grant access to the database
After the Create a login procedure,
DA_Mary has access to the specified instance of SQL Server 2005, but does not have permission to access the staging databases.
DA_Mary does not have access to the default database until you authorize
DA_Mary as a database user.
DA_Mary access, switch to the database, and then use the
CREATE USER statement to map
DA_Mary's login to a user name.
To create a user in a database and add the user as member to specific permissions
Type and run the following statements (replacing
domain_namewith the name of your domain) to grant
DA_Maryaccess to the
USE [Staging_TestData]; GO CREATE USER [DA_Mary] FOR LOGIN [domain_name\DA_Mary]; GO
Use the following fixed database roles to grant permissions to the staging database.
USE [Staging_TestData] EXEC sp_addrolemember N'db_datareader', N'domain_name\DA_Mary GO USE [Staging_TestData] EXEC sp_addrolemember N'db_datawriter', N'domain_name\DA_Mary GO USE [Staging_TestData] EXEC sp_addrolemember N'db_owner', N'domain_name\DA_Mary GO
You must determine which permissions are required for sources tables.