SALES: 1-800-867-1380

ALTER LOGIN (Azure SQL Database)

This topic is OBSOLETE. You can find the most current version in the SQL 14 Transact-SQL Reference.

ImportantImportant
This topic is not maintained. For the current version, see ALTER LOGIN.

Changes the properties of a database login account in Microsoft Microsoft Azure SQL Database. You must be connected to the master database to alter a login.

Syntax Conventions (Azure SQL Database)


ALTER LOGIN login_name 
    { 
    <status_option> 
    | WITH <set_option> [ ,... ]
    } 

<status_option> ::=ENABLE | DISABLE

<set_option> ::=            
    PASSWORD ='password' 
    [ 
      OLD_PASSWORD ='oldpassword'
            
    ]
    | NAME = login_name

This syntax diagram demonstrates the supported arguments and options in Microsoft Azure SQL Database.  

Microsoft Azure SQL Database does not support the following arguments and options when using the ALTER LOGIN statement:

  • <set_option> options:

    • DEFAULT_DATABASE

    • DEFAULT_LANGUAGE

    • CHECK_POLICY

    • CHECK_EXPIRATION

    • CREDENTIAL

    • NO CREDENTIAL

    • hashed_password

  • <password_option> options:

    • MUST_CHANGE

    • UNLOCK

  • <cryptographic_credentials_option> options:

    • ADD CREDENTIAL

    • DROP CREDENTIAL

For more information about the arguments and the ALTER LOGIN statement, see ALTER LOGIN in SQL Server Books Online.

With some methods of connecting to Microsoft Azure SQL Database, such as sqlcmd, you must append the Azure SQL Database server name to the login name in the connection string by using the <login>@<server> notation. For example, if your login is login1 and the fully qualified name of the Azure SQL Database server is servername.database.windows.net, the username parameter of the connection string should be login1@servername.

Because the total length of the username parameter is 128 characters, loginName is limited to 127 characters minus the length of the server name. In the example, loginName can only be 117 characters long because servername is 10 characters.

ImportantImportant
The ALTER LOGIN statement must be the only statement in a SQL batch.

Only the server-level principal login (created by the provisioning process) or members of the loginmanager database role in the master database can create or alter logins.

The password for a login can only be changed by executing the ALTER LOGIN statement while connected to the logical master database. Logins that are not members of the loginmanager role can change their own passwords, however logins are typically not granted access to the logical master database. To grant access to the logical master database, the loginmanager must create a user in the master database for the login.

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft