• declare @RES int

    exec @RES = dbo.UDF_GetCheckDigitUCCEAN '0000000001111'

    print @RES

    This yields a value of -8, not a valid value check digit value! I figure it should be 2.

    Cheers!