Description

I write a lot of queries in SQL Server Management Studio. In most queries I need to perform joins. Most inner joins are based on foreign key relations, so it would be perfectly possible to propose a join clause.
Suppose I type the following query:
SELECT *
FROM Employee
INNER JOIN Company ON
And there is a foreign key that specifies that the Company_Ref column always refers to the Company's CompanyId column. In that case it could suggest to autocomplete this statement to:
SELECT *
FROM Employee
INNER JOIN Company ON Employee.Company_Ref = Company.CompanyId
This would save a lot of typing

Assign To

Hello Ramon. Thank you for bringing this to our attention. We really do appreciate the feedback. We’ll investigate and get back to you. -Walter A Jokiel, Program Manager, SQL Server (wajokiel@microsoft.com)

Posted by daveadfadfadf on 9/18/2013 at 8:59 AM

The ANSI standard specifies a NATURAL JOIN which is kinda what you want. But that uses like named cols. I agree that a variant of NATURAL JOIN that uses key relationships would not only alleviate typing, but bugs too. It's real easy to get a JOIN col wrong if you aren't paying attention.

This also follows the principle of "don't repeat yourself." The JOIN condition should be declared once and then used everywhere.