• okbangas (10/21/2011)


    ...and in fact it is kind of the intention too allow a single column represent several types of entities. It would be a nice feature for generalization.

    I thought about what you said, tried to apply it to other use cases, and after a while I did not like where the idea was headed. What you are proposing would be a move towards legitimizing not only audit tables but also centralized lookup tables, by adding DRI support to that concept. However still leaving the data type issue it then creates in the "value" column unaddressed...unless you consider using SQL_VARIANT, XML or NVARCHAR(MAX) as the data-type for your "value" column a proper solution. Is that a good thing? It could be useful in some scenarios I suppose, but then again it appears that it would create more problems than it would solve. Additionally, the platform already allows for us to paint ourselves into a corner this way using triggers to maintain RI manually. Your syntax would certainly be cleaner than implementing a set of triggers, however the bar is high and I think that is a good thing.

    There are no special teachers of virtue, because virtue is taught by the whole community.
    --Plato