Role-Playing Games has a problem with a particular recurring kind of spam, all of which contain email addresses (a deleted example, 10k / mod only).

I'm interested in querying Data Explorer to see what percentage of our undeleted answers actually contain email addresses. I'm not experienced with T-SQL, though, so I'm not sure how I'd go about this in a regular T-SQL environment. Apparently I can't use a query like this:

select [OwnerUserId], [Post Link], Body
from Posts
where contains(Body, '@')

... because I get this error on running it:

Cannot use a CONTAINS or FREETEXT predicate on table or indexed view 'Posts' because it is not full-text indexed.

So what can I do to find posts containing an email address?

1 Answer 1


Data.SE's SQL engine doesn't allow for particularly complex expressions, but you can narrow this down to a reasonable set of posts by using dumb ol' LIKE patterns if you, heh, like:

select OwnerUserId [User Link], Id [Post Link], Body
from Posts
where Body like '%[^ >]@[^ <]%'


  • Oh, that's how I'm meant to use those tags! I'll give this a spin when I'm back at my PC. Aug 11, 2014 at 2:56

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .