Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
One of four possible children
Message
From
04/10/2007 17:08:24
Mike Cole
Yellow Lab Technologies
Stanley, Iowa, United States
 
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Environment versions
SQL Server:
SQL Server 2000
Miscellaneous
Thread ID:
01258745
Message ID:
01258748
Views:
15
I know exactly what you are talking about and asked the question a while ago... unfortunately I didn't explain it as well as you did. I will be watching.

>I have a parent table. Based on a field in the parent table the a record can be linked to 0 or 1 other table. If it is linked to 1 table then it can only be linked in one out of four tables. (yes very confusing)
>
>I would like to build the logic into one stored procedure instead of making 5 separate stored procedures and letting the application choose which SP to call.
>
>TableP:
>
>PK   Type  Description
>--   ----  -----------
>1    A     aaaaa
>2    B     bbbbb
>3    C     ccccc
>4    D     ddddd
>5    E     eeeee
>
>
>TableA:
>
>PK   FK    Sales
>--   ----  -----
>1    1     $150
>
>
>TableB:
>
>PK   FK    Sales
>--   ----  -----
>1    2     $250
>
>
>TableC:
>
>PK   FK    Sales
>--   ----  -----
>1    3     $350
>
>
>TableD:
>
>PK   FK    Sales
>--   ----  -----
>1    4     $450
>
>
>What would be the best way to construct a SP with where I pass a TableP.PK value and return the following fields: TableP.PK, TableP.Type, TableP.Description, Table?.PK, Table?.FK, Table?.Sales
>
>Any thoughts on the subject are welcome.
>
>Einar
Very fitting: http://xkcd.com/386/
Previous
Reply
Map
View

Click here to load this message in the networking platform