rails-sqlserver/activerecord-sqlserver-adapter — pull request #207 by christophritler (2012-06-14 09:16:49+00:00)
Title: Explain queries without placeholders

our application has specific queries, which don't have any "@XX" placeholders. The current explain codes drops part of the query string after the last comma, which results in a very invalid query or even exceptions.

The patch only removes the last segment if there are placeholders in the sql.

I'm not sure if this works for every case but it does for our application.