ALTER CREDENTIAL (Transact-SQL)
Updated: August 19, 2015
Applies To: SQL Server 2014, SQL Server 2016 Preview
Changes the properties of a credential.
Applies to: SQL Server (SQL Server 2008 through current version).
Specifies the name of the credential that is being altered.
- IDENTITY = 'identity_name'
Specifies the name of the account to be used when connecting outside the server.
- SECRET = 'secret'
Specifies the secret required for outgoing authentication. secret is optional.
When a credential is changed, the values of both identity_name and secret are reset. If the optional SECRET argument is not specified, the value of the stored secret will be set to NULL.
The secret is encrypted by using the service master key. If the service master key is regenerated, the secret is reencrypted by using the new service master key.
Information about credentials is visible in the sys.credentials catalog view.
Requires ALTER ANY CREDENTIAL permission. If the credential is a system credential, requires CONTROL SERVER permission.
The following example changes the secret stored in a credential called Saddles. The credential contains the Windows login RettigB and its password. The new password is added to the credential using the SECRET clause.
ALTER CREDENTIAL Saddles WITH IDENTITY = 'RettigB', SECRET = 'sdrlk8$40-dksli87nNN8'; GO
The following example removes the password from a credential named Frames. The credential contains Windows login Aboulrus8 and a password. After the statement is executed, the credential will have a NULL password because the SECRET option is not specified.
ALTER CREDENTIAL Frames WITH IDENTITY = 'Aboulrus8'; GO