Friday, October 03, 2014

Creating a common role with GRANT

USE DB_Name

CREATE ROLE ReaderRole;
GO

GRANT EXECUTE ON SCHEMA :: dbo TO ReaderRole;
GRANT SELECT ON SCHEMA :: dbo TO ReaderRole;

GO
CREATE ROLE WriterRole;
GO

GRANT INSERT ON SCHEMA :: dbo TO WriterRole;
GRANT UPDATE ON SCHEMA :: dbo TO WriterRole;
GRANT EXECUTE ON SCHEMA :: dbo TO WriterRole;
GRANT SELECT ON SCHEMA :: dbo TO WriterRole;
or
GRANT SELECT ON SCHEMA :: dbo TO [Domain\User];

0 Comments:

Post a Comment

<< Home