• dglane (11/11/2008)


    I had found that article too but I would really love to find your comment (i.e. "Some RDBMS vendors, like Oracle but not SQL Server, implement a NATURAL JOIN operator" -- italics added by me) in that article or some other source that I could offer the test admin.

    You can use any SQL Server to prove this.

    Just type in the following:

    SELECT *

    From sys.tables t1

    INNER JOIN sys.tables t2

    ON t1.object_id=t2.object_id;

    GO

    SELECT *

    From sys.tables t1

    NATURAL JOIN sys.tables t2;

    Note that the first one works, but the second one gives a Syntax Error. Note also that although "INNER" is highlighted (grey on my machine), "NATURAL" is not, indicating that it is not recognized as a keyword.

    Note also, that the Books Online article "Using Joins" lists all of the possible Join types: "NATURAL" is not listed there. Note also that the Books Online "FROM (Transact-SQL)" article in the Transact-SQL Reference manual, does not list "NATURAL" as a valid join type under "{joined_table}: ... {join_type}:" in the syntax diagram.

    Note finally, that "if it ain't in the syntax diagram, then it ain't valid syntax".

    (Language Reference manuals only ever list what is valid, they never list things that are "invalid", as that is infinite.)

    If that does not work, then challenge you Test Admin to get any SQL command with "NATURAL JOIN" in it to work on any SQL Server.

    The Admin gave you the wrong test.

    [font="Times New Roman"]-- RBarryYoung[/font], [font="Times New Roman"] (302)375-0451[/font] blog: MovingSQL.com, Twitter: @RBarryYoung[font="Arial Black"]
    Proactive Performance Solutions, Inc.
    [/font]
    [font="Verdana"] "Performance is our middle name."[/font]