Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
One of four possible children
Message
De
04/10/2007 17:08:24
Mike Cole
Yellow Lab Technologies
Stanley, Iowa, États-Unis
 
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Versions des environnements
SQL Server:
SQL Server 2000
Divers
Thread ID:
01258745
Message ID:
01258748
Vues:
14
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/
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform