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

CREATE USER (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 CREATE USER.

Adds a user to the current database.

Syntax Conventions (Azure SQL Database)


CREATE USER user_name
    [ { { FOR | FROM }
      { 
        LOGIN login_name 
      } 
      | WITHOUT LOGIN
      }
    ] 
    [ WITH DEFAULT_SCHEMA = schema_name ]

This syntax diagram demonstrates the supported arguments in Windows Azure SQL Database.

Windows Azure SQL Database does not support the following arguments when using the CREATE USER statement.

  • CERTIFICATE

  • ASYMMETRIC_KEY

If the CREATE USER statement is the only statement in a SQL batch, Windows Azure SQL Database supports the FOR | FROM LOGIN clause. If the CREATE USER statement is not the only statement in a SQL batch or is executed in dynamic SQL, the FOR | FROM LOGIN clause is not supported.

noteNote
The user_name argument cannot contain a backslash (\) character.

Remarks

When ran while connected to a federation member database, this command supports the following syntax:

CREATE USER user_name
[;]

For a code example, see Managing Databases and Logins in Azure SQL Database. For more information about the arguments and the CREATE USER statement, see CREATE USER in SQL Server Books Online.

Requires ALTER ANY USER permission on the database.

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

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.