UFN_PLANNEDGIFTDESIGNATIONS_DESIGNATION_ISUNIQUE
Checks if Designations within Planned Gift Designations are unique
Return
| Return Type | 
|---|
| int | 
Parameters
| Parameter | Parameter Type | Mode | Description | 
|---|---|---|---|
| @PLANNEDGIFTID | uniqueidentifier | IN | |
| @DESIGNATIONID | uniqueidentifier | IN | 
Definition
 Copy 
                                    
        create function dbo.UFN_PLANNEDGIFTDESIGNATIONS_DESIGNATION_ISUNIQUE
        (
            @PLANNEDGIFTID uniqueidentifier,
            @DESIGNATIONID uniqueidentifier
        )
        returns integer
        with execute as caller
        as begin
            declare @return integer
            declare @count integer
            set @return = 1
            if @DESIGNATIONID is not null
            begin
            select @count=count(*) from PLANNEDGIFTDESIGNATION 
                        where DESIGNATIONID = @DESIGNATIONID and PLANNEDGIFTID = @PLANNEDGIFTID
                if @count > 1
                    set @return = 0 ;
            end
            return @return ;                
        end