tags:

views:

356

answers:

1

I had a script run against one of my databases that attempted to drop a bunch of users. All the users that had the drop attempted against them were disabled and displayed the little red down arrow on their icon in Management Studio.

I was able to revive all of the normal users by issuing the "alter login myLogin enable" command. However, when I try to do that against the sys, guest or information_schema users, I get the "Cannot alter the login 'myLogin', because it does not exist or you do not have permission. I'm logged in as a system administrator.

How do I enable these accounts?

+2  A: 

The objects you have listed are Schemas and Database Users, not SQL Server Logins and hence why they are not found using the ALTER LOGIN statement.

To answer your second question, a Database User displayed graphically within the security folder of a given database will display a red down arrow when it does not have CONNECT permission granted on the database. This can be added using the following command:

   GRANT CONNECT TO guest

again REVOKED with the following command:

REVOKE CONNECT FROM guest
John Sansom
It is not possible to drop the sys schema in SQL 2005 and 2008.
Philip Kelley
Never tried myself ;-)
John Sansom
I'll buy that. That makes perfect sense. I guess my question then is why do they show up under the databases as disabled with the little red down arrow?
anopres
@anopres:I have ammended the answer to address your additional query.
John Sansom
ok, that works for the guest account, but the sys and information_schema accounts throw "Cannot grant, deny, or revoke permissions to sa, dbo, entity owner, information_schema, sys, or yourself" errors. Any thoughts?
anopres