Adding a SQL Server Login to a DB role

  • I am trying to add a SQL login to a DB role using sp_addrolemember. This is the statement I am running :

    execute sp_addrolemember 'db_owner','tsrweb'

    I am getting this error:

    Server: Msg 15410, Level 11, State 1, Procedure sp_addrolemember, Line 66

    User or role 'tsrweb' does not exist in this database.

    When a use a windows account works fine.

    Any ideas?

    Carlos

  • You need to run sp_grantdbaccess to add the login to the database first. Then  you can add the user to the db role

  • Thanks a lot !!!

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

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