In focus

How To Create Credential In SQL Server

In this article we will learn to create credential in SQL Server. A credential is a record having the information of authentication which is required to connect to a resource outside the SQL Server.

Anmol Garg Apr 06, 2016

Introduction

We can create a credential both manually and by using SQL commands but before starting we should know what credential is. A credential is a record having the information of authentication which is required to connect to a resource outside the SQL Server, that means it allows users who are connected to Microsoft SQL Server using SQL Authentication to connect to other resources outside the SQL Server or to Windows also.

It requires Windows user name and password.

Step 1 - Open MS SQL Server Management studio.

Step 2 - 
Expand Security.

Step 3 - Right click on Credentials then, click New Credential.


Step 4 - Fill the name for credential. Fill the name of the windows account that you are using.



Fill in identity box the valid windows user account or you can also browse the verified user account.

Enter the windows user account password & click OK.

We can also createa  credential by using SQL Commands:
  1. USE  [master]  
  2. CREATE CREDENTIAL [TstCredential] WITH  
  3. IDENTITY = N'DESKTOP24\anmol'
  4. SECRET = N'anmol’  
Now expand credentials and you can see a new credential created as below:

credential security sql server

COMMENT USING