How to grant a role to a user

  • I created a number of roles one of them being Principal. I want to grant this role to the user ravid. Please enlighten me on what is the correct syntax to achieve this.

    I have tried:

    "Grant principal to ravid" which generate the following syntax error:

    Msg 102, Level 15, State 1, Line 1

    Incorrect syntax near 'Principal'.

    Please help.

  • sp_addrolemember [ @rolename = ] 'role',

    [ @membername = ] 'security_account'

  • Can it be done at all with a T-SQL Statement instead of a stored procedure? Just asking.

  • it worked perfectly in my vb code though.

    Thank you very much for sharing your knowledge with a pesky newbie such as myself.

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply