How do you store data in a SQL table that could be numeric or not? When it is numeric, you want to treat it as numbers (for analysis like averaging, min, max, custom equations, etc.).
Here's what I'm looking at: Varying pieces of equipment storing time-value pairs for specific attributes. We pull the data from the equipment and want to store it in a database instead of the awful data-duplicating text files. The issue is the value can vary from "On|Off" to "1|0" to "???" depending on the equipment. So true/false pairs can be alpha or numeric, and any value (true/false or readings like temperature) of any attribute can wind up as a series of question marks when the equipment isn't reporting properly. How do you structure your tables, column types, and presentation of this? MS SQL server if it matters, not sure what the presentation layer will be though likely ASP.NET and/or Flash.
I'm not looking for anyone to do the work for me, but looking for at least a start to research this. What comes to mind for me because I can't control the source data is store it as char()/varchar() and use my presentation layer to check each value before doing analysis, but this seems like it could be extremely slow and not scale as data sets grow. Thoughts?
Here's what I'm looking at: Varying pieces of equipment storing time-value pairs for specific attributes. We pull the data from the equipment and want to store it in a database instead of the awful data-duplicating text files. The issue is the value can vary from "On|Off" to "1|0" to "???" depending on the equipment. So true/false pairs can be alpha or numeric, and any value (true/false or readings like temperature) of any attribute can wind up as a series of question marks when the equipment isn't reporting properly. How do you structure your tables, column types, and presentation of this? MS SQL server if it matters, not sure what the presentation layer will be though likely ASP.NET and/or Flash.
I'm not looking for anyone to do the work for me, but looking for at least a start to research this. What comes to mind for me because I can't control the source data is store it as char()/varchar() and use my presentation layer to check each value before doing analysis, but this seems like it could be extremely slow and not scale as data sets grow. Thoughts?