I attempted to run the following query to find posts that are "signed" (ending) with the poster's username:

select top 5 posts.Id as [Post Link] from posts
join users on posts.OwnerUserId=users.id
where posts.body like '%' + users.displayname

In Firefox 7.0.1, the query takes a couple minutes, then the page displays:

Error: Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.

In Chrome 14.0.835.202, the query also takes a couple minutes, then displays a JavaScript alert box reading:

Something is wrong with the server!

In both browsers, I never see any results displayed.

I was able to get the query to work by appending + '%' to the last line (see the modified query here). However, this isn't what I originally intended-- I wanted to search only for posts that end with the user's display name, not for posts that merely contain the user's display name.

share|improve this question
2  
The error message appears to tell you everything you need to know: there is a query timeout that you've reached. I guess SQL Server doesn't do "Ends With" very well at all. –  user7116 Oct 17 '11 at 14:33
add comment

You must log in to answer this question.

Browse other questions tagged .