CREATE FUNCTION [dbo].[GetDefaultEAN] (@ACustomerNumber int) RETURNS varchar(20)
AS
BEGIN
	DECLARE @ResultVar varchar(29)

	SELECT @ResultVar = EAN FROM CustomerEANs (NOLOCK)
	WHERE CustomerNumber = @ACustomerNumber AND EANType = 0
	
	RETURN @ResultVar
END