Skip to main content

CREATE LOGIN (bSQL) | Blockpoint Docs

Creates a login for the MDB instance. For examples, see Examples.

bSQL Syntax Conventions

Syntax​

CREATE LOGIN login_name WITH PASSWORD = "password" [DEFAULT = database_name];

Arguments​

login_name
Specifies the name of the login to be created.

password
Specifies the password for the login that is being created.

DEFAULT = database_name
Specifies the default database to be assigned to the login. If this option is not included, the default database is set to master.

Permissions​

MANAGEMENT permissions required on the master database.

MANAGEMENT permissions default to members of the admin fixed database role. Members of the admin fixed database role can transfer permissions to logins and users.

Remarks​

  • MDB logins are stored in the master database and should be backed up whenever a login is created.

  • The CREATE LOGIN command must be run in autocommit mode and can't be rolled back.

  • Upon logging into the system, if a DEFAULT database has been specified, the system will attempt to connect to that database. If there exists a database user that is mapped to the login, the login inherits the user's permissions and encryption keys and will successfully connect to the default database. If no user is found, an error is produced.

    MDB implements the CREATE LOGIN statement by using the following steps:

  1. MDB stores the salted password information in the master database.
  2. A unique ID is assigned to the login.
  3. The login principal is used to run commands on the master database.

Examples​

Creating a login.​

The following example creates a new login.

CREATE LOGIN <login_name> WITH PASSWORD = "<enterStrongPasswordHere>";

See Also​