SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Urgent: cannot remove database role, ''dbo'' from my permissions


Urgent: cannot remove database role, ''dbo'' from my permissions

Author
Message
Matthew Mark-379998
Matthew Mark-379998
SSC-Enthusiastic
SSC-Enthusiastic (110 reputation)SSC-Enthusiastic (110 reputation)SSC-Enthusiastic (110 reputation)SSC-Enthusiastic (110 reputation)SSC-Enthusiastic (110 reputation)SSC-Enthusiastic (110 reputation)SSC-Enthusiastic (110 reputation)SSC-Enthusiastic (110 reputation)

Group: General Forum Members
Points: 110 Visits: 26

Under Security/Logins I find my user name. Using Database Access tab, I highlight a database. I uncheck "db_owner" in bottom box. I attempt to save it and get:SQL server error 15405: cannot use the reserved user or role name 'dbo'.

As you can see, I'm not, I'm attempting to remove it from my name.

A brief history:

All objects in this database have owner: dbo.

ME, the previous Sysadmin, User Domain\myname was assigned dbo of several databases at the Security\logins level. Security policy has changed and now we need to change to db_dataread, db_datawrite and execute on all stored procs and functions for data manipulation.

In order to test the new concept, I must first remove Domain\myname as dbo, sysadmin and only grant rights (db_dataread, db_datawrite and execute on all stored procs and functions) to the database.

I've Deleted my name as a user from at the database level, as well as remove myself as a SQL Server login.

In effect, 'Domain\myname' a user, having a login, has been deleted.

Now, to test my new permissions, from the SQL Server level, I add myself again, using the same domain\myname(as we are going to windows authentication as this is necessary for the test).

As soon as I create myself in Security/Logins and attempt to close the dialogue box, I get the message "It has been detected that this login has permissions in specific database(s) - the login will have access to these databases now."

It restores me as dbo in all the databases I was in prior to deletion. I cannot uncheck dbo in Database Access and save.

Note: I have stopped and re-started the sql server service.

Can anyone shed light here?


colin.Leversuch-Roberts
colin.Leversuch-Roberts
SSC-Dedicated
SSC-Dedicated (31K reputation)SSC-Dedicated (31K reputation)SSC-Dedicated (31K reputation)SSC-Dedicated (31K reputation)SSC-Dedicated (31K reputation)SSC-Dedicated (31K reputation)SSC-Dedicated (31K reputation)SSC-Dedicated (31K reputation)

Group: General Forum Members
Points: 31167 Visits: 715
Hmmm .. think you might benefit from a good read of BOL or a suitable training course!

The GrumpyOldDBA
www.grumpyolddba.co.uk
http://sqlblogcasts.com/blogs/grumpyolddba/
homebrew01
homebrew01
SSC-Dedicated
SSC-Dedicated (31K reputation)SSC-Dedicated (31K reputation)SSC-Dedicated (31K reputation)SSC-Dedicated (31K reputation)SSC-Dedicated (31K reputation)SSC-Dedicated (31K reputation)SSC-Dedicated (31K reputation)SSC-Dedicated (31K reputation)

Group: General Forum Members
Points: 31340 Visits: 9228
You might get better feedback if you post in one of the SQL subfolders instead of the Notification Services area.




SQLKnight
SQLKnight
SSC Veteran
SSC Veteran (208 reputation)SSC Veteran (208 reputation)SSC Veteran (208 reputation)SSC Veteran (208 reputation)SSC Veteran (208 reputation)SSC Veteran (208 reputation)SSC Veteran (208 reputation)SSC Veteran (208 reputation)

Group: General Forum Members
Points: 208 Visits: 74

Try running orphan user script in each and every user databases. This will drop and clear the anamolies in the user-login conflicts. As you are a sysadmin, you can still be in the group and you will have all the privileges on the system. I want understand why you want to be a user again. Recreate all the database objects with "dbo".

-- Orphan user Security Fix:

DECLARE @username varchar(25)

DECLARE fixusers CURSOR

FOR

SELECT UserName = name FROM sysusers WHERE issqluser = 1 and (sid is not null and sid <> 0x0)

and suser_sname(sid) is null and [name] in (select [name] from master.dbo.syslogins)

ORDER BY name

OPEN fixusers

FETCH NEXT FROM fixusers

INTO @username

WHILE @@FETCH_STATUS = 0

BEGIN

EXEC sp_change_users_login 'update_one', @username, @username

FETCH NEXT FROM fixusers

INTO @username

END

CLOSE fixusers

DEALLOCATE fixusers

GO

Thanks,

.A.


Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum








































































































































































SQLServerCentral


Search