Sybase Alias

Sybase alias is a mechanism within a database to permit multiple users to look like the same user. This is useful in a development environment for object and permission purposes. To add alias, login_name must not be a user of database or dbo.

Syntax for Sybase Alias:
sp_addalias login_name, user_within_database

Example:

use r2schools go sp_addalias george, dbo go

To verify:

1> sp_helpuser george 2> go The name supplied is aliased to another user. Alias_name ID_in_db Group_name Login_name -------------------- ---------------- -------------------- -------------------- dbo 1 public sa

To drop alias:

use r2schools go sp_dropalias george go

To verify:

1> sp_helpuser george 2> go Msg 17703, Level 16, State 1: Server 'LOCALHOST', Procedure 'sp_helpuser', Line 312: The name supplied is not a user, group, or aliased. (return status = 1)