Home All Groups Group Topic Archive Search About
Author
28 Nov 2007 5:57 PM
Adam Sankey
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 a System
Administrator when I could try and fix it.

Something else that has perplexed me since this software was installed is
when I look at the login properties of the sa account and go to the "Database
Acces" tab (Enterprise Manager) the check box "Permit" next to each database
is checked and sa has been given the role db_owner. It's not causing any
obvious problems just a bit annoying as doing this doesn't make any sense!
Can I undo this somehow?

Thanks
Adam

Author
28 Nov 2007 6:24 PM
Ben Nevarez
Hello,

The db_owner permissions for sa on the Database Access tab are set by
default in SQL Server. Do not worry about it. Anyway, sa is the system
administrator and has full permissions on the entire instance. Just give this
account a complex password.

Hope this helps,

Ben Nevarez
Senior Database Administrator
AIG SunAmerica



Show quote
"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 a System
> Administrator when I could try and fix it.
>
> Something else that has perplexed me since this software was installed is
> when I look at the login properties of the sa account and go to the "Database
> Acces" tab (Enterprise Manager) the check box "Permit" next to each database
> is checked and sa has been given the role db_owner. It's not causing any
> obvious problems just a bit annoying as doing this doesn't make any sense!
> Can I undo this somehow?
>
> Thanks
> Adam
>

AddThis Social Bookmark Button