Skip to content

Latest commit

 

History

History
96 lines (62 loc) · 4.67 KB

File metadata and controls

96 lines (62 loc) · 4.67 KB
title Create a Credential | Microsoft Docs
ms.custom
ms.date 03/14/2017
ms.prod sql-server-2016
ms.reviewer
ms.suite
ms.technology
database-engine
ms.tgt_pltfrm
ms.topic article
helpviewer_keywords
credentials [SQL Server], creating
authentication [SQL Server], credentials
logins [SQL Server], credentials
ms.assetid c1e77e91-2a69-40d9-b8b3-97cffc710586
caps.latest.revision 17
author BYHAM
ms.author rickbyh
manager jhubbard

Create a Credential

This topic describes how to create a credential in [!INCLUDEssCurrent] by using [!INCLUDEssManStudioFull] or [!INCLUDEtsql].

Credentials provide a way to allow [!INCLUDEssNoVersion] Authentication users to have an identity outside of [!INCLUDEssNoVersion]. This is primarily used to execute code in Assemblies with EXTERNAL_ACCESS permission set. Credentials can also be used when a [!INCLUDEssNoVersion] Authentication user needs access to a domain resource, such as a file location to store a backup.

A credential can be mapped to several [!INCLUDEssNoVersion] logins at the same time. A [!INCLUDEssNoVersion] login can only be mapped to one credential at a time. After a credential is created, use the Login Properties (General Page) to map a login to a credential.

In This Topic

Before You Begin

Limitations and Restrictions

  • If there is no login mapped credential for the provider, the credential mapped to [!INCLUDEssNoVersion] service account is used.

  • A login can have multiple credentials mapped to it as long as they are used with distinctive providers. There must be only one mapped credential per provider per login. The same credential can be mapped to other logins.

Security

Permissions

Requires ALTER ANY CREDENTIAL permission to create or modify a credential and ALTER ANY LOGIN permission to map a login to a credential.

Using SQL Server Management Studio

To create a credential

  1. In Object Explorer, expand the Security folder.

  2. Right-click the Credentials folder and select New Credential….

  3. In the New Credential dialog box, in the Credential Name box, type a name for the credential.

  4. In the Identity box, type the name of the account used for outgoing connections (when leaving the context of [!INCLUDEssNoVersion]). Typically, this will be a Windows user account, but the identity can be an account of another type.

    Alternately, click the ellipsis (…) to open the Select User or Group dialog box.

  5. In the Password and Confirm password boxes, type the password of the account specified in the Identity box. If Identity is a Windows user account, this is the Windows password. The Password can be blank, if no password is required.

  6. Select Use Encryption Provider to set the credential to be verified by an Extensible Key Management (EKM) Provider. For more information, see Extensible Key Management (EKM)

  7. [!INCLUDEclickOK]

Using Transact-SQL

To create a credential

  1. In Object Explorer, connect to an instance of [!INCLUDEssDE].

  2. On the Standard bar, click New Query.

  3. Copy and paste the following example into the query window and click Execute.

    -- Creates the credential called "AlterEgo.".   
    -- The credential contains the Windows user "Mary5" and a password.  
    CREATE CREDENTIAL AlterEgo WITH IDENTITY = 'Mary5',   
        SECRET = '<EnterStrongPasswordHere>';  
    GO  
    

For more information, see CREATE CREDENTIAL (Transact-SQL).