How do I assign the select permission to a role in SQL SERVER?

3

I have the following activity and my code marks me wrong, can anyone tell me what I did wrong?

--8.-Asignar el permiso Select a este rol
    grant select on database Prueba to role 'GranSelectRole';

Mark me an error in the "to" saying this: Incorrect syntax near to. Expecting DOUBLECOLON or ID. What is the correct syntax? Thanks in advance.

    
asked by Rainerio Amezquita Sanchez 20.09.2018 в 05:57
source

2 answers

1

Deal with:

 grant select on database Prueba to 'GranSelectRole';

I do not think it is necessary to specify "role"

    
answered by 20.09.2018 / 09:12
source
1

Try this, it worked for me:

USE Prueba;
GRANT SELECT TO GranSelectRole;

Good luck!

    
answered by 17.10.2018 в 18:33