February 15, 2012 at 2:21 pm
I shy away from SQL Server Authentication but in this case I have to use it.
I created the following Roles:
CREATE ROLE DatabaseUser
CREATE ROLE DatabaseDeveloper
Now I want to assign db_datareader Database Fixed Role to the DatabaseUser Role.
I also want to assign the db_datareader, db_datawriter and db_DDLAdmin Database Fixed Roles to the DatabaseDeveloper Role that I created
Could someone please tell me the syntax. I had to work on another project and I need to set up by COB?
Thanks.
For better, quicker answers on T-SQL questions, click on the following...
http://www.sqlservercentral.com/articles/Best+Practices/61537/
For better answers on performance questions, click on the following...
http://www.sqlservercentral.com/articles/SQLServerCentral/66909/
February 15, 2012 at 2:27 pm
here you go:
CREATE ROLE DatabaseUser
EXEC sp_addrolemember N'db_datareader', N'DatabaseUser'
CREATE ROLE DatabaseDeveloper
EXEC sp_addrolemember N'db_ddladmin', N'DatabaseDeveloper'
EXEC sp_addrolemember N'db_datareader', N'DatabaseDeveloper'
EXEC sp_addrolemember N'db_datawriter', N'DatabaseDeveloper'
Lowell
February 15, 2012 at 3:22 pm
Rings a bell.:-)
Thanks Lowell!
For better, quicker answers on T-SQL questions, click on the following...
http://www.sqlservercentral.com/articles/Best+Practices/61537/
For better answers on performance questions, click on the following...
http://www.sqlservercentral.com/articles/SQLServerCentral/66909/
Viewing 3 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply