Hi Dudes
Can any one tell how can i use natural join in sql server 2005
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Jiteendra SampathiraoPosted Jul 26, 2011, 7:42 AM
natural joins are not available in Sql server 2005...
refer
For Sql joins Click Here
hope it help you.......
Zoran HorvatPosted Jul 26, 2011, 7:43 AM
CREATE TABLE Position (
PositionID INT PRIMARY KEY IDENTITY(1, 1),
Name VARCHAR(100)
);
CREATE TABLE Employee (
EmployeeID INT PRIMARY KEY IDENTITY(1, 1),
PositionID INT,
Name VARCHAR(100)
);
Natural join in this case would join Name columns in Position and Employee tables as well, but that would be wrong, because those columns specify distinct properties of the position and employee in the database. Correct (manually formed) natural join would be:
SELECT Position.PositionID, Position.Name AS PositionName, Employee.EmployeeID, Employee.Name AS EmployeeName
FROM Position INNER JOIN Employee ON Position.PositionID = Employee.EmployeeID;
Personally, I expect that SQL Server will never support NATURAL JOIN syntax.
Zoran
Blocked AccountPosted Jul 26, 2011, 7:41 AM
There is no Natural Join available in Sql Server.