How can we improve SQL Source Control?

Produce a warning when a JOIN's ON clause does not reference the joined table

During a data-refactoring effort, I accidentally created a query that looked like this:

SELECT *
FROM Customers
JOIN Orders o ON o.CustomerId = o.CustomerId

Obviously, this is wrong, and results in a cross join. It would be great if SQL Prompt could produce a warning when:
1. ON clause compares a column to itself
2. ON clause does not reference the table being joined to

3 votes
Vote
Sign in
Check!
(thinking…)
Reset
or sign in with
  • facebook
  • google
    Password icon
    I agree to the terms of service
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    Chris BristolChris Bristol shared this idea  ·   ·  Flag idea as inappropriate…  ·  Admin →

    0 comments

    Sign in
    Check!
    (thinking…)
    Reset
    or sign in with
    • facebook
    • google
      Password icon
      I agree to the terms of service
      Signed in as (Sign out)
      Submitting...

      Feedback and Knowledge Base