Pending communication

I tried to delete the Pending communication(comm_status from database in dbo.communication based on User. I can't see the relation between the table other then channel id.I checked in Dbo.comm_link where i can see the relation but i can't find comm_status in it. Can some one help me?

  • 0

    When you say deleted, do you mean you have deleted them using a DELETE statement, or have you updated them so their comm_deleted = 1?

    If you have just updated them, you can use this:

    UPDATE Comm_Link

    SET cmli_deleted = 1

    FROM Comm_Link

    INNER JOIN Communication on cmli_comm_communicationId = comm_communicationId

    WHERE cmli_deleted IS NULL AND comm_status = 'Pending'

    If you have run a DELETE statement, then you could find all comm_link records that do not have an existing communication record:

    SELECT Comm_Link.*

    FROM Comm_Link

    LEFT JOIN Communication on comm_communicationId = cmli_comm_communicationId

    WHERE comm_communicationId IS NULL AND cmli_comm_communicationId IS NOT NULL

    The records returned here do not have a communication attached to them.