Stored Procedure to....
Hello All! I'm back once again. I've had some success creating stored procedures once i understood it, but i'm back for more questions as i am stumped!!
Scenario:
We have two tables.
1) Articles
Fields:
ArticleID, HeadLine, AuthorID
2) ArticlesDetails
Fields:
ArticlesDetailsID, ArticleID, Text, LineNumber
Alright well, to give a bit of a description,
the Articles table stores all the information except for the body of hte article, that is stored in the articlesDetails table hence the Text and LineNumber field. I set the length of the Text Field to 500 Characters so if the article body lets say for example is 1000 charaters long, then we have two entries for the articlesDetails table breaking apart the article into two separate portions in the articleDetails table. well if you can't figure out what i'm gonna ask, well here goes.
I need a storedProcedure that accepts an ArticleID
And returns me back one entry that stores the ArticleID, HeadLine, AuthorID, and the Whole article from the details table in the field WholeArticle
so basically i call it like such
sp_GetWholeArticle 321
And that would return me in one entry the entire articles "stuff"
I guess my problem is getting back the representation of all the entries in the details table for the articleID=@ArticleID
any thoughts? thanks
|