/* * 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. */ CREATEPROCEDURE[dbo].[GetSystemValidationByKey] @inNameKeyvarchar(16) as setnocounton
selecttop(1) KeyValue, EffectiveDateUtc, ExpirationDateUtc from[Validation] whereNameKey=@inNameKeyand IsSystemValidation=1 orderbyNameKeyasc,ValidationIDasc GO GRANTEXECUTEON[dbo].[GetSystemValidationByKey]TO[MssExec] GO