sp_CreateUser

Advantage SQL Engine

Create a new user in the database.

Syntax

sp_CreateUser(

UserName,CHARACTER,50,

Password,CHARACTER,20,

Comment,MEMO )

Parameters

UserName (I)

Name of the user to create.

Password (I)

Initial password for the user. This parameter can be NULL or an empty string to specify no password for this user.

Comment (I)

Optional description of the user. This parameter can be NULL.

Remarks

sp_CreateUser creates a user object in the database. The initial password can be changed by sp_ModifyUserProperty. Creating users in the database allows the administrator to control who has access to what table in the database. When a database is created, it by default to allow anonymous connections to the database and no access rights checking is performed. Those options can be turned on by sp_ModifyDatabase.

Example

After making a connection to the database, create a user named "User1" in the database and grant the user read only permission to the "Customer Information" table.

EXECUTE PROCEDURE sp_CreateUser(

‘User1’,

NULL,

‘This user has read rights to tables.’ );

 

GRANT SELECT ON "Customer Information" TO User1;

See Also

sp_ModifyDatabase

sp_DropUser

sp_ModifyUserProperty

sp_CreateGroup

sp_DropGroup

sp_AddUserToGroup

sp_RemoveUserFromGroup