UFN_SITEID_MAPFROM_OPPORTUNITYID

Maps an OPPORTUNITYID to a SITEID

Return

Return Type
table

Parameters

Parameter Parameter Type Mode Description
@OPPORTUNITYID uniqueidentifier IN

Definition

Copy


            create function dbo.UFN_SITEID_MAPFROM_OPPORTUNITYID(@OPPORTUNITYID uniqueidentifier)    

            returns table
            as  
            return
                select PROSPECTPLANSITE.SITEID   
                from dbo.OPPORTUNITY O  
                left outer join dbo.PROSPECTPLANSITE on O.PROSPECTPLANID = PROSPECTPLANSITE.PROSPECTPLANID  
                where O.ID = @OPPORTUNITYID;