Binding close votes

0

Please login or register to vote for this query.

(click on this box to dismiss)

Forked from rene's answer here: https://meta.stackexchange.com/a/234057

Stack Overflow

Q&A for professional and enthusiast programmers

declare @userid as nvarchar(32)
declare @uid as int = ##UserId##
select @userid='"Id":'+cast(@uid as nvarchar)+','

select postid as [Post Link]
, @userid, len(@userid)
, [text]
, reverse([text])
, charindex(':"dI"{', reverse([text]))
, charindex(reverse(@userid), reverse([text]))
from posthistory
where posthistorytypeid = 10
and [text] like '%'+@userid+'%'
and [text] like '%BindingReason%'
and (charindex(':"dI"{', reverse([text])) - (len(@userid)-5) = 
    charindex(reverse(@userid), reverse([text])))
ORDER BY creationdate

Enter Parameters

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