----------------
AccessFlagLookup
----------------
SELECT AccessFlagLookupID, AccessFlag, Description, LastUpdated,
LastUpdatedBy, CAST(TS AS INT) AS TS FROM AgencyNET.AccessFlagLookup
INSERT INTO [AgencyNET].[AccessFlagLookup] ([AccessFlag], [Description],
[LastUpdatedBy]) VALUES (@AccessFlag, @Description, @LastUpdatedBy);SELECT
AccessFlagLookupID, CAST(TS AS INT) AS TS FROM AgencyNET.AccessFlagLookup
WHERE (AccessFlagLookupID = SCOPE_IDENTITY())
UPDATE [AgencyNET].[AccessFlagLookup] SET [AccessFlag] = @AccessFlag,
[Description] = @Description, [LastUpdated] = getutcdate(), [LastUpdatedBy]
= @LastUpdatedBy WHERE (([AccessFlagLookupID] =
@Original_AccessFlagLookupID) AND (CAST(TS AS INT) = @Original_TS));SELECT
CAST(TS AS INT) AS TS FROM AgencyNET.AccessFlagLookup WHERE
(AccessFlagLookupID = @AccessFlagLookupID)
DELETE FROM [AgencyNET].[AccessFlagLookup] WHERE (([AccessFlagLookupID] =
@Original_AccessFlagLookupID) AND (CAST(TS AS INT) = @Original_TS))
-