任何人都可以向我解释如何使用以下语法:
-- Syntax for Azure SQL Database
ALTER USER userName
WITH <set_item> [ ,...n ]
<set_item> ::=
NAME = newUserName
| DEFAULT_SCHEMA = schemaName
| LOGIN = loginName
| ALLOW_ENCRYPTED_VALUE_MODIFICATIONS = [ ON | OFF ]
[;]
-- Azure SQL Database Update Syntax
ALTER USER userName
WITH <set_item> [ ,...n ]
[;]
<set_item> ::=
NAME = newUserName
| DEFAULT_SCHEMA = { schemaName | NULL }
| LOGIN = loginName
| PASSWORD = 'password' [ OLD_PASSWORD = 'oldpassword' ]
| ALLOW_ENCRYPTED_VALUE_MODIFICATIONS = [ ON | OFF ]
-- SQL Database syntax when connected to a federation member
ALTER USER userName
WITH <set_item> [ ,… n ]
[;]
我是通过此链接https://docs.microsoft.com/en-us/sql/t-sql/statements/alter-user-transact-sql
获得的由于
答案 0 :(得分:2)
我为ALTER USER找到的最重要的用途是它可以帮助您将数据库用户映射到服务器登录。它允许解决数据库用户和服务器登录之间的映射问题
ALTER USER DBuser TO UserLogin
您还可以使用它来更改数据库用户的默认架构
ALTER USER [DBUser] WITH DEFAULT_SCHEMA = [NewSch]
最后,您可以使用它来更改包含SQL Azure的数据库用户的密码。包含的用户没有相关的服务器登录。
ALTER USER DBUser WITH PASSWORD = '{your new password}'
希望这有帮助。