USP_EVENTSITE_VALIDATESITES

Checks that a site has only been defined once for a given event.

Parameters

Parameter Parameter Type Mode Description
@EVENTSITES xml IN

Definition

Copy


            CREATE procedure dbo.USP_EVENTSITE_VALIDATESITES(@EVENTSITES xml)
            with execute as caller
            as            
                declare @ERRORMESSAGE nvarchar(max);

                declare @DULICATEID uniqueidentifier
                select top 1 @DULICATEID = SITEID from dbo.UFN_EVENT_GETSITES_FROMITEMLISTXML(@EVENTSITES) as SITES group by SITEID having count(SITEID) > 1

                if @DULICATEID is not null begin
                    select @ERRORMESSAGE = NAME + ' is selected more than once.' from dbo.SITE where SITE.ID = @DULICATEID;
                    raiserror(@ERRORMESSAGE, 13, 1);
                end