For a userid, do a text search of all posts

2

Please login or register to vote for this query.

(click on this box to dismiss)

Emacs

Q&A for those using, extending or developing Emacs

-- Search all userid posts for postbody
-- Wildcard search by default

DECLARE @UserId int = ##UserId##


SELECT
    Posts.Id as [Post Link],
    Posts.PostTypeId,
    Posts.Body
FROM Posts
WHERE 
    Posts.OwnerUserId = @UserId and
    (Posts.Body LIKE '%##PostBody##%')
ORDER BY Posts.PostTypeId

Enter Parameters

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