Export (0) Print
Expand All
Expand Minimize

IS_OBJECTSIGNED (Transact-SQL)

Indicates whether an object is signed by a specified certificate or asymmetric key.

Topic link iconTransact-SQL Syntax Conventions


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

'OBJECT'

The type of securable class.

@object_id

The object_id of the object being tested. @object_id is type int.

@class

The class of the object:

  • 'certificate'

  • 'asymmetric key'

@class is sysname.

@thumbprint

The SHA thumbprint of the object. @thumbprint is type varbinary(32).

IS_OBJECTSIGNED returns the following values.

Return value

Description

0

The object is not signed.

1

The object is signed.

NULL

The object is not valid.

Requires VIEW DEFINITION on the certificate or asymmetric key.

A. Displaying extended properties on a database

The following example tests if the spt_fallback_db table in the master database is signed by the schema signing certificate.

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?] ;

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft