Assigning Roles to the Database User

Posted by Bandi under Sql Server category on | Points: 40 | Views : 635
The user should have some privileges on the database such as select data, Insert/Update/Delete data, execute procedures and so on...

To give a user the limited access to the database, we have to create a user role with the required privileges, then we need to assign the role to DATABASE USER...

-- Assign specific role to database user
/* EXEC sp_addrolemember ‘RoleName’, ‘Database User Name’*/
EXEC sp_addrolemember N'FullPermissionsRole', N'TestUser'

Comments or Responses

Login to post response