Condividi tramite


IS_OBJECTSIGNED (Transact-SQL)

Si applica a: SQL Server database SQL di Azure Istanza gestita di SQL di Azure

Indica se un oggetto viene firmato da una chiave asimmetrica o da un certificato specificato.

Convenzioni relative alla sintassi Transact-SQL

Sintassi

IS_OBJECTSIGNED (   
'OBJECT', @object_id, @class, @thumbprint  
  )   

Nota

Per visualizzare la sintassi Transact-SQL per SQL Server 2014 (12.x) e versioni precedenti, vedere Documentazione delle versioni precedenti.

Argomenti

'OBJECT'
Tipo di classe a protezione diretta.

@object_id
object_id dell'oggetto sottoposto a test. @object_id è di tipo int.

@class
Classe dell'oggetto.

  • 'certificate'

  • 'asymmetric key'

@class è sysname.

@thumbprint
Identificazione digitale SHA dell'oggetto. @thumbprint è di tipo varbinary(32).

Tipi restituiti

int

Osservazioni:

IS_OBJECTSIGNED restituisce i valori seguenti.

Valore restituito Descrizione
NULL L'oggetto non è firmato oppure non è valido.
0 L'oggetto è firmato, ma la firma non è valida.
1 L'oggetto viene firmato.

Autorizzazioni

È richiesta l'autorizzazione VIEW DEFINITION per il certificato o la chiave asimmetrica.

Esempi

R. Visualizzazione delle proprietà estese in un database

L'esempio seguente verifica se la tabella spt_fallback_db del database master è firmata dal certificato di firma dello schema.

USE master;  
-- Declare a variable to hold a thumbprint and an object name  
DECLARE @thumbprint varbinary(20), @objectname sysname;  
  
-- Populate the thumbprint variable with the thumbprint of   
-- the master database schema signing certificate  
SELECT @thumbprint = thumbprint   
FROM sys.certificates   
WHERE name LIKE '%SchemaSigningCertificate%';  
  
-- Populate the object name variable with a table name in master  
SELECT @objectname = 'spt_fallback_db';  
  
-- Query to see if the table is signed by the thumbprint  
SELECT @objectname AS [object name],  
IS_OBJECTSIGNED(  
'OBJECT', OBJECT_ID(@objectname), 'certificate', @thumbprint  
) AS [Is the object signed?] ;  

Vedi anche

sys.fn_check_object_signatures (Transact-SQL)