Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Your suggestion IS the elegant, powerful, best practice solution.</p> <p>Since I don't think the other answers said the following strongly enough, I'm going to do it.</p> <p>If your developers 1) can't understand how to model a many-to-many relationship in a relational database, and 2) strongly insist on storing your CategoryIDs as delimited character data,</p> <p>Then they ought to immediately lose all database design privileges. At the very least, they need an actual experienced professional to join their team who has the authority to stop them from doing something this unwise and can give them the database design training they are completely lacking.</p> <p>Last, you should not refer to them as "database developers" again until they are properly up to speed, as this is a slight to those of us who actually are competent developers &amp; designers.</p> <p>I hope this answer is very helpful to you.</p> <p><strong>Update</strong></p> <blockquote> <p>The main point of my question is not developer confusion and what to do about it.</p> <p>The point is to understand when delimited values are the right solution.</p> </blockquote> <p>Delimited values are the wrong solution except in extremely rare cases. When individual values will ever be queried/inserted/deleted/updated this proves it was the wrong decision, because you have to parse and touch all the other values just to work with the desired one. By doing this you're violating <strong>first</strong> (!!!) normal form (this phrase should sound to you like an unbelievably vile expletive). Using XML to do the same thing is wrong, too. Storing delimited values or multi-value XML in a column <em>could</em> make sense when it is treated as an indivisible and opaque "property bag" that is NOT queried on by the database but is always sent whole to another consumer (perhaps a web server or an EDI recipient).</p> <p>This takes me back to my initial comment. Developers who think violating first normal form is a good idea are very inexperienced developers in my book.</p> <p>I will grant there are some pretty sophisticated non-relational data storage implementations out there using text property bags (such as Facebook(?) and other multi-million user sites running on thousands of servers). Well, when your database, user base, and transactions per second are big enough to need that, you'll have the money to develop it. In the meantime, stick with best practice.</p>
 

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