UFN_SCHEMA_TRIGGER_GETISSYSTEMFLAG
Return
| Return Type |
|---|
| bit |
Parameters
| Parameter | Parameter Type | Mode | Description |
|---|---|---|---|
| @TABLENAME | nvarchar(128) | IN | |
| @TRIGGERNAME | nvarchar(128) | IN |
Definition
Copy
CREATE function [dbo].[UFN_SCHEMA_TRIGGER_GETISSYSTEMFLAG]
(
@TABLENAME nvarchar(128),
@TRIGGERNAME nvarchar(128)
) returns bit
with execute as caller
as
begin
declare @value bit;
select @value = cast(ep.value as bit) from
sys.extended_properties as ep
inner join sys.triggers as tt on ep.major_id=tt.object_id
where ep.class=1
and ep.minor_id=0
and ep.name=N'BB_IsSystem'
and tt.parent_id=OBJECT_ID(@TABLENAME)
and tt.name=@TRIGGERNAME;
select @value = case when @value is null then 0 else @value end;
return @value;
end