UFN_CONSTITUENTMATCH_STREETNUMBERSCOREDEDUCTION_BYRESULT

Return

Return Type
table

Parameters

Parameter Parameter Type Mode Description
@STREETNUMBERRESULT tinyint IN

Definition

Copy


            create function dbo.UFN_CONSTITUENTMATCH_STREETNUMBERSCOREDEDUCTION_BYRESULT (
                @STREETNUMBERRESULT tinyint
            )
            returns table -- Writing as in-line table for performance vs scalar function

            with schemabinding
            as return
                -- higher deduction for "likely match" since even a small difference is significant

                select
                    case @STREETNUMBERRESULT 
                        when 0 then 0 
                        when 1 then 8 
                        when 2 then 17 
                        when 3 then 24 
                        when 4 then 0 
                        when 5 then 1 
                        when 6 then 3 
                    end as DEDUCTION;