Deleted Answers

0

Please login or register to vote for this query.

(click on this box to dismiss)

SharePoint

Q&A for SharePoint enthusiasts

DECLARE @StartDate DATETIME = '2024-05-06';
DECLARE @EndDate DATETIME = '2024-06-01';

SELECT
    p.Id AS [PostId],
    p.Body AS [AnswerBody],
    p.Score AS [AnswerScore],
    p.OwnerUserId AS [UserId],
    u.DisplayName AS [UserName],
    u.Reputation AS [UserReputation],
    ph.CreationDate AS [DeletionDate]
FROM
    PostHistory ph
    INNER JOIN Posts p ON ph.PostId = p.Id
    INNER JOIN Users u ON p.OwnerUserId = u.Id
WHERE
    ph.PostHistoryTypeId IN (12) -- Check for different types of deletions
    AND p.PostTypeId = 2 -- Ensure the post is an answer
    AND ph.CreationDate BETWEEN @StartDate AND @EndDate
ORDER BY
    ph.CreationDate DESC;

Enter Parameters

Options:
Switch to meta site
loading Hold tight while we fetch your results