fnGetNetAccountRelations

Return

Return Type
table

Parameters

Parameter Parameter Type Mode Description
@NetAccountID int IN

Definition

Copy



CREATE FUNCTION [dbo].[fnGetNetAccountRelations]
            (
            @NetAccountID int
            )
            RETURNS Table
            AS
            RETURN

            SELECT 

            ID,
            NetAccountID 'MyAccountID',
            RelationAccountID 'FriendAccountID',
            Confirmation,
            ConfirmationDate,
            CreateDate,
            UpdateDate

            FROM [NetAccountRelation] 
            WHERE

            NetAccountID = @NetAccountID 
            AND 
            (BlockedID = 0 OR BlockedID IS NULL)
            AND
            Confirmation > 0

            UNION

            SELECT 

            ID,
            RelationAccountID 'MyAccountID',
            NetAccountID 'FriendAccountID',
            Confirmation,
            ConfirmationDate,
            CreateDate,
            UpdateDate

            FROM [NetAccountRelation] 
            WHERE

            RelationAccountID = @NetAccountID 
            AND 
            (BlockedID = 0 OR BlockedID IS NULL)
            AND
            Confirmation > 0