Missing post IDs

0

Please login or register to vote for this query.

(click on this box to dismiss)

SharePoint

Q&A for SharePoint enthusiasts

SELECT p.Id+1, p.CreationDate, n.NextId - p.Id - 1 AS 'Missing post ID',
  CONCAT('site://posts/', p.Id + 1, '/revisions') AS 'First missing post'
  FROM Posts AS p
  CROSS APPLY (
    SELECT MIN(Id) AS NextId FROM Posts WHERE Id > p.Id
  ) n
  WHERE n.NextId - p.Id != 1
  and p.DeletionDate >= ##date1:string## and p.DeletionDate <= ##date2:string##  
  ORDER BY p.Id

Enter Parameters

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