Hello, I have a problem with adding users to a database using sp_adduser.
The user I'm using is a member of db_owner but I receive the following error:
sp_adduser adam, adam, DEFAULT_USERS
Server: Msg 15247, Level 16, State 1, Procedure sp_adduser, Line 35
User does not have permission to perform this action
It only works when I log in as a System Administrator. However if I login as
the db_owner account which generates the above error and run the following:
exec sp_grantdbaccess adam
exec sp_addrolemember DEFAULT_USERS, adam
It works fine. The problem is that it is a piece of 3rd party software that
is trying to add the users and won't be easy to get them to change it as
sp_adduser should work. Also I don't want them logging in as System
Administrator when I could try and fix it. Any ideas?
One solution is to drop the user from the database, and then make its login
the owner of the database:
sp_dropuser 'the_user'
go
use the_database
go
sp_changedbowner 'the_login'
go
Linchi
"Adam Sankey" wrote:
> Hello, I have a problem with adding users to a database using sp_adduser.
> The user I'm using is a member of db_owner but I receive the following error:
> sp_adduser adam, adam, DEFAULT_USERS
> Server: Msg 15247, Level 16, State 1, Procedure sp_adduser, Line 35
> User does not have permission to perform this action
> It only works when I log in as a System Administrator. However if I login as
> the db_owner account which generates the above error and run the following:
> exec sp_grantdbaccess adam
> exec sp_addrolemember DEFAULT_USERS, adam
> It works fine. The problem is that it is a piece of 3rd party software that
> is trying to add the users and won't be easy to get them to change it as
> sp_adduser should work. Also I don't want them logging in as System
> Administrator when I could try and fix it. Any ideas?
>
|||Thanks very much that worked fine - I still don't understand why I had this
problem in the first place. Do you have an insight in to this?
Thanks again
Adam
"Linchi Shea" wrote:
[vbcol=seagreen]
> One solution is to drop the user from the database, and then make its login
> the owner of the database:
> sp_dropuser 'the_user'
> go
> use the_database
> go
> sp_changedbowner 'the_login'
> go
> Linchi
> "Adam Sankey" wrote:
No comments:
Post a Comment