sysusers (all databases)

Contains one row for each user allowed to use the database and one row for each group.

When SQL Server is initially installed, master..sysusers contains three entries: dbo, with an suid of 1 and a uid of 1; guest, with a suid of -1 and uid of 2; and public, with an suid of -2 and a uid of 0. The sysusers table in the model database (and thus in all user databases) initially contains two entries: dbo and public.

The guest user provides access to the database to users not explicitly listed in sysusers, with a restricted set of permissions. The guest entry in master means that any user with an account on SQL Server (that is, with an entry in syslogins) can access master.

The public user refers to all users. The keyword PUBLIC is used with the GRANT and REVOKE statements to signify that permission is granted to or taken away from all users.

Column Datatype Description
suid smallint Server user ID, copied from syslogins. A suid of 1 is the system administrator, -1 is a guest account.
uid smallint User ID, unique in this database. A uid 1 is the database owner.
gid smallint Group ID to which this user belongs. If uid = gid, this entry defines a group. The public group has a suid equal to -2. All other groups have a suid equal to -gid.
name varchar(30) Username or group name, unique in this database.
environ varchar(255) Reserved.

Index

sysusers clustered, unique on suid

ncsysusers1 nonclustered, unique on name

ncsysusers2 nonclustered, unique on uid

Referenced by Stored Procedures

sp_addalias sp_depends sp_helpgroup
sp_addgroup sp_dropgroup sp_helprotect
sp_adduser sp_droplogin sp_helpuser
sp_changedbowner sp_droptype sp_stored_procedures
sp_changegroup sp_dropuser sp_table_privileges
sp_column_privileges sp_helparticle sp_tables
sp_dboption