UFN_PROSPECTPLAN_GETSITELIST

Returns a comma delimited list of sites associated with the given prospect plan.

Return

Return Type
nvarchar(1024)

Parameters

Parameter Parameter Type Mode Description
@PROSPECTPLANID uniqueidentifier IN

Definition

Copy


            CREATE function dbo.UFN_PROSPECTPLAN_GETSITELIST(
                @PROSPECTPLANID uniqueidentifier
            )
            returns nvarchar(1024)
            as
            begin
                --DanielCo[02/27/09] - ensuring site list is ordered, mainly for unit tests

                declare @SITES nvarchar(1024);
                select 
                    @SITES = dbo.UDA_BUILDLIST(NAME) 
                from 
                    (select top 1000 SITE.NAME 
                    from dbo.UFN_PROSPECTPLAN_GETSITES(@PROSPECTPLANID) PLANSITE
                    inner join dbo.SITE on SITE.ID = PLANSITE.SITEID
                    order by SITE.NAME) ORDEREDSITES;

                return @SITES;            
            end