SQL Server 2008r2
我正在尝试删除我创建的证书,但出现以下错误
无法删除证书,因为一个或多个实体已使用它进行签名或加密
使用这个查询我已经确定了有问题的实体
SELECT SCHEMA_NAME(so.[schema_id]) AS [SchemaName],
so.[name] AS [ObjectName],
so.[type_desc] AS [ObjectType],
---
scp.crypt_type_desc AS [SignatureType],
ISNULL(sc.[name], sak.[name]) AS [CertOrAsymKeyName],
---
scp.thumbprint
FROM sys.crypt_properties scp
INNER JOIN sys.objects so
ON so.[object_id] = scp.[major_id]
LEFT JOIN sys.certificates sc
ON sc.thumbprint = scp.thumbprint
LEFT JOIN sys.asymmetric_keys sak
ON sak.thumbprint = scp.thumbprint
WHERE so.[type] <> 'U'
AND ISNULL(sc.[name], sak.[name]) = 'Certificate_name'
ORDER BY [SchemaName], [ObjectType], [ObjectName], [CertOrAsymKeyName];
但是当我尝试使用以下语句删除签名时:
DROP SIGNATURE FROM OBJECT::dbo.sp_sqlagent_notify BY CERTIFICATE Certificate_name
我让他们跟随错误。
证书“Certificate_name”的签名不存在。
我究竟做错了什么?
提前致谢。
我的错。
我应该使用
代替