Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
mason
Starting Member
11 Posts |
Posted - 2003-06-09 : 16:04:41
|
| Trying to figure out how to create a stored procedure that will return records from two tables (Table 1 and Table 2) linked on an ID field which is part of table 1 as an equal join. I have to use OJ syntax. Any help would be greatly appreciated. |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2003-06-09 : 16:11:18
|
| Mason, you haven't really given much information. But here is a sample:CREATE PROC usp_SampleProcASSELECT a.Column1, b.Column3, a.Column2FROM Table1 aINNER JOIN Table2 b ON a.Column1 = b.Column1RETURNBTW, is this a homework assignment? Also, what is OJ syntax?Tara |
 |
|
|
mason
Starting Member
11 Posts |
Posted - 2003-06-09 : 16:12:48
|
| Hi Tara,It's self study. As for OJ Syntax, that's Outer Join syntax. |
 |
|
|
chadmat
The Chadinator
1974 Posts |
Posted - 2003-06-09 : 21:58:03
|
| You would still use Tara's query, just change INNER to LEFT, or RIGHT depending on which table you want all of the rows from.-Chadhttp://www.clrsoft.comSoftware built for the Common Language Runtime. |
 |
|
|
|
|
|