SALES: 1-800-867-1380

ALTER USER (Azure SQL Database)

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

Renames a database user or changes its default schema.

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

Syntax Conventions (Azure SQL Database)

ALTER USER userName  
     WITH <set_item> [ ,...n ]

<set_item> ::= 
          NAME =newUserName 
          | DEFAULT_SCHEMA =schemaName
          | LOGIN = loginName

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

If the ALTER USER statement is the only statement in a SQL batch, Microsoft Azure SQL Database supports the WITH LOGIN clause. If the ALTER USER statement is not the only statement in a SQL batch or is executed in dynamic SQL, the WITH LOGIN clause is not supported.

When used while connected to a federation member, the following syntax is supported:

     WITH <set_item> [ ,…n ]

<set_item> ::=
     NAME = newUserName

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

Requires ALTER ANY USER permission on the database.

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

Community Additions

© 2014 Microsoft