Link to home
Start Free TrialLog in
Avatar of CipherIS
CipherISFlag for United States of America

asked on

SQL Server SPROC SIGNATURE CERTIFICATE

How can you tell if a SPOC is signed with a certificate?

Working on a dbase and apparently a certificate was used.  Having issues accessing data from the database and believe this is the issue.
Avatar of Russ Suter
Russ Suter

This query will give you a list of all stored procedures in the database that have a certificate.
SELECT
	*
FROM
	[sys].[procedures]
LEFT JOIN
	[sys].[crypt_properties] ON
	[sys].[crypt_properties].[major_id] = [sys].[procedures].[object_id]
WHERE
	[major_id] IS NOT NULL

Open in new window

Avatar of CipherIS

ASKER

Thanks.  It seems that the stored procedures were signed with a certificate.  Would backing up the database cause not being able to log in from the website?

I am having issues connecting to the database.  I wrote a small app to test.  I can connect to the database but when I perform a select statment against a table I get:

"The SELECT permission was denied on the object 'xxxxxxxxx', database 'xxxxxx', schema 'dbo'."}
    [System.Data.SqlClient.SqlException]: {"The SELECT permission was denied on the object 'xxxxxxx', database 'xxxxx', schema 'dbo'."}
    Data: {System.Collections.ListDictionaryInternal}
    HelpLink: null
    HResult: -2146232060
>> It seems that the stored procedures were signed with a certificate.  Would backing up the database cause not being able to log in from the website?

Need more info, do you mean to say that you were having issues after taking a backup of the database..
If so, then it shouldn't..

If you wish to backup and restore the database in another server, then you would need to do the following:
1. Create the same certificate in the destination db server.
2. Take the backup from Source DB server.
3. Restore it in Destination DB Server.

Kindly try recreating the certificate if you have made any changes recently..

FYI, please find the steps to do the backup or restore of a database with Encryption enabled.
https://solutioncenter.apexsql.com/backup-and-restore-sql-server-backup-encryption/
This question needs an answer!
Become an EE member today
7 DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform.
View membership options
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.