IS_OBJECTSIGNED (języka Transact-SQL)
Wskazuje, czy obiekt jest podpisany przez określony certyfikat czy klucz asymetryczny.
IS_OBJECTSIGNED (
'OBJECT', @object_id, @class, @thumbprint
)
Argumenty
'OBJECT'
Cache Hit Ratio@object\_id
The object_id of the object being tested.@object\_id is type int.@class
Cache Object Counts*"certyfikat"
"klucz asymetrycznego"
@class jest sysname.
@thumbprint
The SHA thumbprint of the object.@thumbprint is type varbinary(32).
Zwracane typy
int
Remarks
Any SET statement can be specified inside a stored procedure, except SET SHOWPLAN_TEXT and SET SHOWPLAN_ALL.
Zwracanie wartości |
Description |
|---|---|
0 |
These must be the only statements in the batch. |
1 |
The SET option chosen remains in effect during the execution of the stored procedure and then reverts to its former setting. |
WARTOŚCI NULL |
Inside a stored procedure, object names used in all Data Definition Language (DDL) statements such as CREATE, ALTER, or DROP statements, DBCC statements, EXECUTE and dynamic SQL statements must be qualified with the name of the object schema if users other than the stored procedure owner are to use the stored procedure. |
Uprawnienia
Definicja VIEW wymaga certyfikat lub klucz asymetrycznego.
Przykłady
A.Requires CREATE PROCEDURE permission in the database and ALTER permission on the schema in which the procedure is being created.
For CLR stored procedures, requires ownership of the assembly referenced in method_specifier , or REFERENCES permission on that assembly.
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?] ;
.gif)