<p>I need to give users the ability to optionally add metadata to documents. Another way to state this is the fact that users need to add at least 5 categories to a document.</p>

<p>Basically what I want to do is dynamically add metadata (or categories) to a document on an ad hoc basis. Here are the options that I have thought of:</p>

<p><strong>Option 1:</strong>
Should I do this by dynamically creating new table columns in the database? </p>

<p><strong>Option 2:</strong>
Should I define 5 columns called attirbute1,attirbute2,attirbute3,attirbute4,attirbute5 and then only use and show them if the user requires the attributes. </p>

<p><strong>Option 3:</strong>
Should I create a metadata table that keeps track of the columns and the data associated with them? </p>

<p>What do you think is the best way to achieve this? Can you think of any other ways to easily add this functionality. The problem is that the functionality needs to be very generic.</p>

Each document has a unique DocumentID.
Just add another table that has three columns:
```
DocumentID
MetaName
MetaData
```
Then they can add as many pieces of metadata to a given document.  If all their documents use the same metanames then it's trivial to search the metadata.
-Adam