Page 1 of 1

TVF_GetCodeRef

Posted: Thu Mar 02, 2017 10:59 pm
by robinwilson16
Returns the code reference for the selected lookup

Code: Select all

CREATE FUNCTION [dbo].[TVF_GetCodeRef](@Code VARCHAR(10),@Domain VARCHAR(25))
RETURNS TABLE

AS

RETURN 
	SELECT
		Value = VC.vc_ref
	FROM 
		ulive.dbo.caps_valid_codes VC
	WHERE     
		VC.vc_domain = @Domain 
		AND vc_code = @Code