Search code examples
sql-servercertificatecode-signing

Add signature to stored procedure by certificate after alter


I have a stored procedure signed with a certificate. After changing it with ALTER, it seems to lose the signature. I have to rerun ADD SIGNATURE TO to get it back.

Is there some way to prevent this from happening? Otherwise I have to remember to rerun the ADD SIGNATURE script anytime I make changes to the procedure.


Solution

  • MSDN documentation states that the signature is dropped when the module is changed.

    https://learn.microsoft.com/en-us/sql/t-sql/statements/add-signature-transact-sql?view=sql-server-ver15

    Naturally, when something is changed, its signature also changes. Otherwise, signatures would be pretty useless.