Scalar-valued Functions [dbo].[HasTrueValueForGlobalSystemOption]
Properties
PropertyValue
ANSI Nulls OnYes
Quoted Identifier OnYes
Parameters
NameData TypeMax Length (Bytes)
@optionNamevarchar(128)128
Permissions
TypeActionOwning Principal
GrantExecuteMssExec
SQL Script
CREATE FUNCTION [dbo].[HasTrueValueForGlobalSystemOption]
(
    @optionName varchar(128)
)
RETURNS bit
AS
BEGIN
declare @retVal bit

    select @retVal = convert(bit,
        case
            when exists (select top 1 1 from GlobalSystemOption where Name = @optionName and [Value] = 'True') then 1
            else 0 end )

    return @retVal;
END
GO
GRANT EXECUTE ON  [dbo].[HasTrueValueForGlobalSystemOption] TO [MssExec]
GO
Uses