0 out of 3 rated this helpful - Rate this topic

ALTER LOGIN (Windows Azure SQL Database)

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

Syntax Conventions (Windows 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 Windows Azure SQL Database.  

Windows 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 Windows Azure SQL Database, such as sqlcmd, you must append the 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 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.

Did you find this helpful?
(1500 characters remaining)

Community Additions

ADD
© 2013 Microsoft. All rights reserved.
facebook page visit twitter rss feed newsletter