Dump your own posts, e.g. for backup purposes.
Q&A for Ubuntu users and developers
-- Dump your own posts -- Dump your own posts, e.g. for backup purposes. DECLARE @UserId int = ##UserId## ; WITH transclosure(Id, OwnerUserId, ParentId, Title, Body, level) as ( select a.Id, a.OwnerUserId, a.ParentId, a.Title, a.Body,0 from Posts as a where OwnerUserId = @UserID UNION ALL SELECT b.Id, b.OwnerUserId, b.ParentId, b.Title, b.Body,c.level+1 FROM Posts as b, transclosure as c WHERE b.Id = c.ParentId ) select * from transclosure ;