I have the following script:
ALTER ROLE [db_datareader] ADD MEMBER [DomainGroup123]
when I run this against SQL Server 2008 R2 I get this error:
Msg 156, Level 15, State 1, Line 1
Incorrect syntax near the keyword 'ADD'.
I have looked online, and found examples that use this exact statement (but with a different user.)
I have double checked that the login exists and is a valid user on the database I am using. Also I have SA permissions on the server.
What am I mssing?
Right-click the role you want to edit and select Properties. In the Database Role Properties -database_role_name dialog box, in the General page, click Add. In the Select Database User or Role dialog box, under Enter the object names to select (examples), enter the login or database role to add to this database role.
To grant permissions for the user, switch to the Object Permissions tab. In the Objects block, select the database object on which you want to grant privileges. In the Available Privileges block, select the permissions to be assigned and click Save.
Use sp_addrolemember.
EXECUTE sp_addrolemember db_datareader, 'UserName'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With