Stored Procedures [dbo].[GetValidationByKey]
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 validation value by key name that is currently
* effective.
*/

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

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