Q&A about the site for members of the workforce navigating the professional setting
DECLARE @BatchSize INT = 50000; DECLARE @Offset INT = 0; WHILE 1 = 1 BEGIN select t.tagName, e.body as 'Excerpt', w.body as 'WikiBody' from tags t left join Posts e on t.ExcerptPostId = e.Id left join Posts w on t.WikiPostId = w.Id order by t.tagName OFFSET @Offset ROWS FETCH NEXT @BatchSize ROWS ONLY; IF @@ROWCOUNT < @BatchSize BREAK; SET @Offset += @BatchSize; END