Export (0) Print
Expand All

CREATE USER (Azure SQL Database)

Updated: April 24, 2014

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 Microsoft Azure SQL Database.

Microsoft 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, Microsoft 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
[;]
ImportantImportant
The current implementation of Federations will be retired with Web and Business service tiers. Consider deploying custom sharding solutions to maximize scalability, flexibility, and performance. For more information about custom sharding, see Scaling Out Azure SQL Databases.

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.

Community Additions

ADD
Show:
© 2014 Microsoft