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