{"id":37,"date":"2011-07-05T09:27:36","date_gmt":"2011-07-05T09:27:36","guid":{"rendered":"https:\/\/sqlserverlearner.azurewebsites.net\/2011\/07\/05\/create-credential-syntax-sql-server\/"},"modified":"2011-07-05T09:27:36","modified_gmt":"2011-07-05T09:27:36","slug":"create-credential-syntax-sql-server","status":"publish","type":"post","link":"https:\/\/sqlserverlearner.com\/2011\/07\/05\/create-credential-syntax-sql-server\/","title":{"rendered":"CREATE CREDENTIAL SYNTAX – SQL SERVER"},"content":{"rendered":"

CREATE CREDENTIAL SYNTAX:<\/strong><\/p>\n

Syntax for creating credentials:
\n[sql]
\nCREATE CREDENTIAL credentialname WITH IDENTITY = ‘identity_name’
\n, SECRET = ‘secret’
\nFOR CRYPTOGRAPHIC PROVIDER cryptographic_provider_name
\n[\/sql]<\/p>\n

credentialname<\/strong> \u2013 Name of the credential, this is used for refereceing the credential
\nIDENTITY<\/strong> \u2013 This is basically the username
\nSECRET<\/strong> \u2013 Password of the identity\/username.
\nCRYPTOGRAPHIC PROVIDER<\/strong> \u2013 Name of Enterprise Key Management Provider.<\/p>\n

SECRET and cryptographic_provider_name are optional in the above syntax.<\/p>\n

Example:
\n[sql]
\nUSE [master]
\nGO
\nCREATE CREDENTIAL [credential1] WITH IDENTITY = N’username’, SECRET = N’password’
\nGO
\n[\/sql]<\/p>\n

CRYPTOGRAPHIC PROVIDER can be created and used with credentials.<\/p>\n

Syntax for creating CRYPTOGRAPHIC PROVIDER:
\n[sql]
\nCREATE CRYPTOGRAPHIC PROVIDER provider_name
\nFROM FILE = ‘path of the dll’
\n[\/sql]<\/p>\n

The dll provided above should implement SQL Server Extensible Key Management interface.<\/p>\n

CREATING CREDENTIAL USING SQL SERVER MANAGEMENT STUDIO:<\/strong><\/p>\n