Summary Table

Categories Total Count
PII 0
URL 0
DNS 0
EKL 0
IP 0
PORT 0
VsID 0
CF 0
AI 0
VPD 0
PL 0
Other 0

File Content

?-- =============================================
-- Description: Returns associated id of the various Access Level constant. Doing it this way to ensure easy changing of values in one place.
-- TBD : this seems like a bit of a hack. Not happy with the code smell it's putting off, but can't get the CASE WHEN
-- to produce a desired output. But it does beat having to potentially update several stored procs
--
-- Maintenance Log:
--
-- Update By Update Date Description
-- ----------- --------- ----------------------------
-- Ken Baker 02/11/10 Created
-- =============================================
CREATE FUNCTION seclyr.[ufnGetAccessLevelConstant]
(
@name varchar(50)
)
RETURNS tinyint
AS
BEGIN
DECLARE @value tinyint;
SELECT @value = AccessLevelID FROM seclyr.AccessLevels WHERE AccessLevelName = @name;

/*******
NOTE: This next snippet of code is necessary for unit testing, until Microsoft fixes a bug in the Test Data Generator
which seems to not want to create primary keys that start with 1 after the initial test data insertion.
Supposedly they're going to fix it in a future release...supposedly
*/
--IF @value = 1
-- BEGIN
-- DECLARE @dbName varchar(1000)
-- SELECT @dbName = DB_NAME()
-- IF CHARINDEX('_Test', @dbName) > 0
-- BEGIN
-- SET @value = 5
-- END
-- END
------END OF TEST TWEAK SNIPPET CODE---------

RETURN @value;
END
GO