Aliases

An alias is a database username that is shared by several login IDs. An alias allows you to treat more than one person as the same user inside a database, giving all of them the same permissions. A common use for aliases is to allow several users to assume the role of database owner (DBO).

To create an alias, you assign a login ID to an existing database username, instead of creating a unique username specifically for that login ID. Any username in a database can serve as an alias.

If you assign a login ID to an alias, that login ID cannot be assigned any other username in that database. Nor can that login ID be assigned to a database group, since it automatically belongs to the groups (public and, optionally, one other) that the alias belongs to.

Aliases can be used to set up a collective user identity, within which the identities of individual users can be traced. For example, suppose several vice presidents want to use a database with identical privileges and ownerships. You could:

  1. Add a separate SQL Server login ID for each vice president.
  2. Assign a new username in the database, vp, to one of the login IDs.
  3. Provide appropriate permissions in the database to the user vp.
  4. Assign the other login IDs to the alias vp.

In the preceding example, all the vice presidents have common capabilities within the database.

If a user is already authorized to use the database, you must drop the username for that login ID before you can assign an alias to it.