When I execute ALTER ROLE db_owner ADD MEMBER A
it gives out following error.
Msg 15151, Level 16, State 1, Line 4
Cannot alter the role 'A', because it does not exist or you do not have permission.
Here ALTER ROLE it mentions that;
Limitations and restrictions
You cannot change the name of a fixed database role.
But I can't find any relationship to this with the error. What I'm trying to do is adding a member not changing the fixed role name.
Any support in resolving this matter is highly appreciated
I think that you are missing a step. You have a login, but you are not adding the login as a user to the database. All the steps below are what you need. The CREATE USER
step (a database level call) seems to be missing from your work.
I don't think you need the CREATE LOGIN
, I just wanted to include that so one could see all it takes to do this.
USE [master]
GO
CREATE LOGIN [A] WITH PASSWORD=N'<password>', DEFAULT_DATABASE=[master], CHECK_EXPIRATION=OFF, CHECK_POLICY=OFF
GO
USE [YourDatabase]
GO
CREATE USER [A] FOR LOGIN [A]
GO
ALTER ROLE db_owner ADD MEMBER [A]
GO
Change YourDatabase
to the proper value before you try this.
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