title: Choosing a schema for SQL lookup table in the context of LINQ to SQL: sql_variant or multiple fields
body: <p>I have a question similar to <a href="https://stackoverflow.com/questions/3882519/storing-unknown-datatype-in-ms-sql-server-database">this</a> but in the context of L2S. I want to create a lookup table to store values that could be one of several possible datatypes. As suggested in the referenced question, I could use <code>sql_variant</code> datatype. However, L2S maps <code>sql_variant</code> to <code>Object</code>, which is suboptimal. I'm guessing it's possible to get at the table metadata to find out the exact type, but I expect that would be too messy. Has anyone tried it?</p>
  
  <p>Another possibility is to split the data across multiple tables, each containing one strongly-typed field, and a master table that would contain the discriminator. But, here I run into another problem: L2S only supports one type of inheritance: Table per Class Hierarchy. So, naturally, my next thought was to put all the value columns and the discriminator in one table. This way I could have an abstract parent class and several inheriting members. The columns would have to be called something like ValueInt, ValueDec, etc. although in the ORM I can rename them all Value. So, that seems like an OK solution but still slightly awkward: all the NULL's in the table for one.  Anyone with better thoughts?</p>
  
  <p>P.S. As an aside, all the lookup values are currently stored as applicationSettings in the config file, which does provide strong-typing, but there are other issues with it.</p>