Note that there are some explanatory texts on larger screens.

plurals
  1. POHow do I enforce data integrity rules in my database?
    primarykey
    data
    text
    <p>I'm designing this collection of classes and abstract (MustInherit) classes…</p> <p><a href="http://img396.imageshack.us/img396/1711/nodeclassinheritanceej0.gif" rel="nofollow noreferrer">class diagram http://img396.imageshack.us/img396/1711/nodeclassinheritanceej0.gif</a></p> <p>This is the database table where I'm going to store all this…</p> <p><a href="http://img179.imageshack.us/img179/3237/nodetablenorootln3.gif" rel="nofollow noreferrer">database table http://img179.imageshack.us/img179/3237/nodetablenorootln3.gif</a></p> <p>As far as the Microsoft SQL Server database knows, those are all nullable ("Allow Nulls") columns.</p> <p>But really, that depends on the class stored there: LinkNode, HtmlPageNode, or CodePageNode.</p> <p>Rules might look like this...</p> <p><a href="http://img127.imageshack.us/img127/74/datarulesha0.gif" rel="nofollow noreferrer">rules table http://img127.imageshack.us/img127/74/datarulesha0.gif</a></p> <p>How do I enforce such data integrity rules within my database?</p> <hr> <p>UPDATE: Regarding this single-table design...</p> <p>I'm still trying to zero in on a final architecture.</p> <p>I initially started with many small tables with almost zero nullalbe fields.<br> <a href="https://stackoverflow.com/questions/56981/which-is-the-best-database-schema-for-my-navigation">Which is the best database schema for my navigation?</a></p> <p>And I learned about the LINQ to SQL IsDiscriminator property.<br> <a href="https://stackoverflow.com/questions/57152/whats-the-best-way-to-handle-one-to-one-relationships-in-sql">What’s the best way to handle one-to-one relationships in SQL?</a></p> <p>But then I learned that LINQ to SQL only supports single table inheritance.<br> <a href="https://stackoverflow.com/questions/67659/can-a-linq-to-sql-isdiscriminator-column-not-inherit">Can a LINQ to SQL IsDiscriminator column NOT inherit?</a></p> <p>Now I'm trying to handle it with a collection of classes and abstract classes.<br> <a href="https://stackoverflow.com/questions/84263/please-help-me-with-my-net-abstract-classes">Please help me with my .NET abstract classes.</a></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload