Re: Keeping a table in a column



Thanks for the reply Rob. I have to concede that it is not the best
data model in the world. Actually I'm battling with a very complex
legacy ( 7 years old ) application which is in intensive care. At the
moment a redesign is the best option technically but not feasible /
cost effective form a business point of view.

In the end I've created a column of type int that references the
sysobjects.id column to solve the problem.

There are I'm sure better ways to achieve this.

R.

Rob Verschoor wrote:
By the sound of it I fear that your application will not be likely to win
prizes for 'best data modelling'.
Anyway, you could include an additional column indicating (a code or
something) the table to relate the row to. When writing joins, you'll need
some big case-expressions to join the row to one table or the other (or the
other-other) depending on that code in that column.
You may find it's best to go back to the drawing board an design a new data
model though, since your queries will be ugly, and likely perform badly as
well.

HTH,

Rob V.
-------------------------------------------------------------
Rob Verschoor

Certified Sybase Professional DBA for ASE 12.5/12.0/11.5/11.0
and Replication Server 12.5 / TeamSybase

Author of Sybase books (order online at www.sypron.nl/shop):
"Tips, Tricks & Recipes for Sybase ASE" (new edition!)
"The Complete Sybase ASE Quick Reference Guide" (new edition!)
"The Complete Sybase Replication Server Quick Reference Guide"

mailto:rob@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
http://www.sypron.nl
Sypron B.V., P.O.Box 10695, 2501HR Den Haag, The Netherlands
-------------------------------------------------------------

"RickB" <rick.bourner@xxxxxxxxx> wrote in message
news:1168592873.834134.142930@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hi

It would be really kind if someone could answer my question:

I have one master table that has a column which holds a reference one
of N sub tables. Each record in the master table can reference a
different subtable. I need a column in the master table that can hold
that reference - how should I do it?

Many thanks,

RickB


.