Evenimente
31 mar., 23 - 2 apr., 23
Cel mai mare eveniment de învățare SQL, Fabric și Power BI. 31 martie – 2 aprilie. Utilizați codul FABINSIDER pentru a economisi 400 USD.
Înregistrați-vă astăziAcest browser nu mai este acceptat.
Faceți upgrade la Microsoft Edge pentru a profita de cele mai noi funcții, actualizări de securitate și asistență tehnică.
Applies to:
SQL Server
This topic describes how to create a credential in SQL Server by using SQL Server Management Studio or Transact-SQL.
Credentials provide a way to allow SQL Server Authentication users to have an identity outside of SQL Server. This is primarily used to execute code in Assemblies with EXTERNAL_ACCESS permission set. Credentials can also be used when a SQL Server Authentication user needs access to a domain resource, such as a file location to store a backup.
A credential can be mapped to one SQL Server login, and a SQL Server 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.
If there is no login mapped credential for the provider, the credential mapped to SQL Server 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.
Requires ALTER ANY CREDENTIAL permission to create or modify a credential and ALTER ANY LOGIN permission to map a login to a credential.
In Object Explorer, expand the Security folder.
Right-click the Credentials folder and select New Credential....
In the New Credential dialog box, in the Credential Name box, type a name for the credential.
In the Identity box, type the name of the account used for outgoing connections (when leaving the context of SQL Server). 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.
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.
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)
Select OK.
In Object Explorer, connect to an instance of Database Engine.
On the Standard bar, click New Query.
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).
Evenimente
31 mar., 23 - 2 apr., 23
Cel mai mare eveniment de învățare SQL, Fabric și Power BI. 31 martie – 2 aprilie. Utilizați codul FABINSIDER pentru a economisi 400 USD.
Înregistrați-vă astăziInstruire
Modul
Explore authentication - Training
In this module, you will learn about the differences between authentication and authorization.
Certificare
Certificat Microsoft: asociat de administrator de identitate și acces - Certifications
Demonstrează caracteristicile Microsoft Entra ID pentru a moderniza soluțiile de identitate, a implementa soluții hibride și a implementa guvernanța identității.
Documentație
Create a database user - SQL Server
Learn how to create the most common types of database users by using SQL Server Management Studio or Transact-SQL.
Grant a Permission to a Principal - SQL Server
Learn how to grant permission to a principal in SQL Server by using SQL Server Management Studio or Transact-SQL, including best practices.
CREATE CREDENTIAL (Transact-SQL) - SQL Server
CREATE CREDENTIAL (Transact-SQL)
CREATE LOGIN (Transact-SQL) - SQL Server
CREATE LOGIN (Transact-SQL)