SALES: 1-800-867-1380
1 out of 6 rated this helpful - Rate this topic

CREATE LOGIN (Azure SQL Database)

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

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

Creates a new database login in Microsoft Windows Azure SQL Database. You must be connected to the master database to create a login.

Syntax Conventions (Azure SQL Database)

CREATE LOGIN login_name { WITH <option_list1> }

<option_list1> ::= 
    PASSWORD = { 'password' }

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 CREATE LOGIN statement:

  • hashed_password

  • MUST_CHANGE option

  • <option_list2> options:

    • SID




    • CHECK_POLICY and


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

In 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, the username parameter of the connection string should be login1@servername.

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

SQL Server rules allow you create a SQL Server authentication login in the format <loginname>@<servername>. If your SQL Azure server is myazureserver and your login is, then you must supply your login as

The CREATE 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 new logins.

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

© 2014 Microsoft. All rights reserved.