Adds a new user to the current database.
sp_adduser loginame [, name_in_db [, grpname]]
is the user’s name in master.dbo.syslogins.
is a new name for the user in the current database.
adds the user to an existing group in the database.
Adds “margaret” to the database. Her database user name is the same as her Adaptive Server login name, and she belongs to the default group, “public”:
Adds “haroldq” to the database. When “haroldq” uses the current database, his name is “harold.” He belongs to the fort_mudge group, as well as to the default group “public”:
sp_adduser haroldq, harold, fort_mudge
The Database Owner executes sp_adduser to add a user name to the sysusers table of the current database, enabling the user to access the current database under his or her own name.
Specifying a name_in_db parameter gives the new user a name in the database that is different from his or her login name in Adaptive Server. The ability to assign a user a different name is provided as a convenience. It is not an alias, as provided by sp_addalias, since it is not mapped to the identity and privileges of another user.
A user and a group cannot have the same name.
A user can be a member of only one group other than the default group, “public”. Every user is a member of the default group, “public”. Use sp_changegroup to change a user’s group.
In order to access a database, a user must either be listed in sysusers (with sp_adduser) or mapped to another user in sysalternates (with sp_addalias), or there must be a “guest” entry in sysusers.
Only the Database Owner, a System Administrator, or a System Security Officer can execute sp_adduser.
Commands grant, revoke, use
System procedures sp_addalias, sp_addgroup, sp_changegroup, sp_dropalias, sp_dropgroup, sp_helpuser