SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 inner join/where vs. enterprise mgr relationships
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

sjlsam
Starting Member

9 Posts

Posted - 04/09/2007 :  14:00:14  Show Profile  Send sjlsam an AOL message  Click to see sjlsam's MSN Messenger address  Reply with Quote
Hello, I am new to SQL and the site, thanks for taking the time to look at my post

I have been building all of my queries using the WHERE clause (which i read functions the same as an INNER JOIN) to deal with my related tables. my boss wants me to look into the functionality of the "Relationships..." option in Enterprise Manager to see if it is more efficient to use and would eliminate the need for a WHERE clause

i have created some relationships using this "Relationships..." dialogue box to test out what happens (without using WHERE in this test scenario), the output seems to remain the same except for the fact that it looks like more rows are being queried to determine which ones are related

can you help me understand what the benefit of doing Relationships through Enterprise Manager is as opposed to using WHERE clauses to join related tables?

harsh_athalye
Flowing Fount of Yak Knowledge

India
5509 Posts

Posted - 04/09/2007 :  14:36:00  Show Profile  Visit harsh_athalye's Homepage  Click to see harsh_athalye's MSN Messenger address  Send harsh_athalye a Yahoo! Message  Reply with Quote
sjlsam,

1.Relationships are created in order to force a column to have its values derived from other related table (foreign key relationship). Basically, this means there are two tables - Parent and Child. Foreign key column in Child table can have only those values which are defined in Parent table's key column.

2.JOINs are used to retrieve data from two or more tables based on some common column

3. WHERE clause is used limit the number of rows based on some condition. It can be used to specify JOIN condition as well but that is not a preferred way.


I suggest you to purchase some good book on SQL Server (like Programming SQL Server by Rob Viera) which can clear your concepts on this. Also, you can go through SQL Server help if that suits you.

Harsh Athalye
India.
"The IMPOSSIBLE is often UNTRIED"
Go to Top of Page

tkizer
Almighty SQL Goddess

USA
36594 Posts

Posted - 04/09/2007 :  14:36:45  Show Profile  Visit tkizer's Homepage  Reply with Quote
Using the JOIN syntax is ANSI compliant whereas what you are doing is not.

Tara Kizer
http://weblogs.sqlteam.com/tarad/
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.05 seconds. Powered By: Snitz Forums 2000