CREATE FUNCTION dbo.getProductCurrencyCode(@ProductNumber int)
RETURNS int
AS
BEGIN
    DECLARE @r int
    SELECT @r = ProductCurrencyCode FROM ProductExtended WITH (NOLOCK) WHERE FK_ProductNumber = @ProductNumber
    RETURN @r
END
GO
