USP_DATALIST_CONSTITUENTSRELATIONSHIPSINFO

Returns information about relationships between the two constituents.

Parameters

Parameter Parameter Type Mode Description
@CONSTITUENTONEID uniqueidentifier IN First constituent ID
@CONSTITUENTTWOID uniqueidentifier IN Second constituent ID

Definition

Copy


                    CREATE procedure dbo.USP_DATALIST_CONSTITUENTSRELATIONSHIPSINFO
                    (
                        @CONSTITUENTONEID uniqueidentifier,
                        @CONSTITUENTTWOID uniqueidentifier
                    )
                    as
                        set nocount on

                        select top 1
                            RELATIONSHIPTYPECODEID,
                            RECIPROCALTYPECODEID,
                            STARTDATE,
                            ISSPOUSE
                        from dbo.RELATIONSHIP
                        where
                            RELATIONSHIPCONSTITUENTID = @CONSTITUENTONEID and
                            RECIPROCALCONSTITUENTID = @CONSTITUENTTWOID
                        order by ISSPOUSE desc -- Return spousal relationships first