|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
You eat, breathe and sleep innovation. Build your mobile intelligence with BlackBerry® experts this July. Register Today! |
|
#1
|
||||
|
||||
|
Hi,
I am in desperate Need of Help with Stored Procedure and Table Relationships. I am using MS SQL 2000 and I am new to stored Procedures. What I have is 2 tables and I am not sure how to write this stored procedure. My Tables look like this... TABLE catList -------------------- catNo | catName -------------------- 1 | Tennis 2 | Basketball 3 | Soccer TABLE students ---------------------- id | name | sport | ... ---------------------- 1 | Jeff | 3 | ... 2 | Lisa | 1 | ... 3 | Bob | 2 | ... 4 | Anna | 1 | ... How do I program my stored procedure so that instead of seeing 1,2 or 3 for sport I would see Tennis, Basketball, or Soccer Please help if you know the answer or a good tutorial that explains how to do that. Thanks, Lito
__________________
Sometimes just a few hours of trial and error debugging can save minutes of reading the manual.
Last edited by lito : February 24th, 2004 at 06:43 PM. |
|
#2
|
|||
|
|||
|
Quote:
Select id, name, catname from students, catlist where catlist.catNo = students.sport simplier if use View instead You just new a store prod and paste above code after AS and before GO |
|
#3
|
||||
|
||||
|
Thanks for your suggestion, but I don’t think that this would work for me. The tables I gave is just a basic example of how my db is setup. The "stored proc" I need to put together would pull from about 6-8 different tables and within those tables I would have foreign key values to a tables that holds a more descriptive word. Maybe this would make more sense...
althoug it doesn't work this should give you a better idea of what I'm up against. Thanks again, Lito PHP Code:
|
![]() |
| Viewing: Dev Shed Forums > Databases > MS SQL Development > Need Help with Stored Procedure and Table Relationships |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|