Stored Procedures [dbo].[GetSystemValidationByKey]
Properties
PropertyValue
ANSI Nulls OnYes
Quoted Identifier OnYes
Parameters
NameData TypeMax Length (Bytes)
@inNameKeyvarchar(16)16
Permissions
TypeActionOwning Principal
GrantExecuteMssExec
SQL Script
/*
* Retrieves the current system validation value by key name.  For system
* validation keys, we only ever expect there to be one such record per
* KeyValue.  If there are multiple, then we'll only return the first one
* by effective date, no matter what that value is and what the current
* utc date is.
*/

CREATE PROCEDURE [dbo].[GetSystemValidationByKey]
    @inNameKey varchar(16)
as
set nocount on

select top (1)
    KeyValue,
    EffectiveDateUtc,
    ExpirationDateUtc
from [Validation]
where NameKey = @inNameKey and
    IsSystemValidation = 1
order by NameKey asc, ValidationID asc
GO
GRANT EXECUTE ON  [dbo].[GetSystemValidationByKey] TO [MssExec]
GO
Uses