all groups > sql server new users > august 2005 >
You're in the

sql server new users

group:

Left outer join


Left outer join Jim in Arizona
8/23/2005 1:52:13 PM
sql server new users:
When we create a diagram which defines the relationship between two tables,
there is no way to specify the exact reltionship type, as there is in
Access.

We need to create a relationship that is, in SQL, a left outer join. In
access, this is easy (gives you three radio buttons and you pick one), but
in SQL, we're frustrated.

The end result:

We are creating a ASP.NET page that is trying to call our database. We have
two tables. In our query we are trying to include all of the records from
the parent table even if there are no records that corresespond in the child
table. We need to run several different queries with different critera with
this type of relationship.

I'm not sure if this is on our ASP.NET code side or our SQL command text
side. I believe the ASP.NET code is creating the relationship but I'm still
not completely sure if it has anything to do with the diagram within
enterprise manager between the two tables.

Any help or advice would be appreciated.
TIA,
Jim

Re: Left outer join Jim in Arizona
8/23/2005 4:37:28 PM
I got my question answered in the aspnet newsgroup. Bruce had this to say:

"you just select the notes that match the tickets. you don't wnat an outer
join becuase thats what you have now (notes without tickets).

select * from TTickets where Resolve =1

select * from TNotes
where FK in (select PK from TTickets where Resolve =1)


-- bruce (sqlwork.com)"

Thanks for your help,
Jim


[quoted text, click to view]

Re: Left outer join Dan Artuso
8/23/2005 7:05:12 PM
Hi,
If you are talking about the EM diagrams, you just right click on the join
and you
can specify whatever type you like, including a Full Outer Join.

Dan Artuso


[quoted text, click to view]

AddThis Social Bookmark Button