sp_get_endpoint_certificate (Transact-SQL)
Applies to:
SQL Server
Azure SQL Managed Instance
Returns a public key of the certificate used for authentication on endpoint of specified type with certificate-based trust configured. Supported types of endpoints are Database Mirroring endpoint (also used for Link feature of Azure SQL Managed Instance) and Service Broker endpoint.
Transact-SQL syntax conventions
Syntax
sp_get_endpoint_certificate [ @endpoint_type = ] endpoint_type
[ ; ]
Arguments
Important
Arguments for extended stored procedures must be entered in the specific order as described in the Syntax section. If the parameters are entered out of order, an error message occurs.
[ @endpoint_type = ] endpoint_type
Type of endpoint for which certificate's public key is required. @endpoint_type is int, and can be one of these values:
Value | Endpoint |
---|---|
3 |
Service Broker |
4 |
Database Mirroring |
Values correspond to the endpoint payload types in sys.endpoints system catalog view.
If any other integer value is provided, stored procedure returns NULL
.
Return code values
0
(success) or 1
(failure).
Result set
Column name | Data type | Description |
---|---|---|
EndpointCertificatePublicKey |
varbinary | Public key of the certificate, in binary format |
Remarks
If authentication type configured on the endpoint isn't certificate-based, stored procedure returns error.
Permissions
User must have VIEW
permission on the endpoint to execute sp_get_endpoint_certificate
.