When you define a property on a class you need to choose a data type for that property. Sometimes this is obvious – if you are going to store a date property value choose the datetime data type. If you are going to be storing a true/false value choose a Boolean value. This blog post will provide a comprehensive explanation of the different data types that are available to help you choose which one is right to store your data.
These are the data types as defined by the 1.1 version of the MP Schema:
They are the same data types as found in the version 1.0 MP schema used in SCOM/SCE 2007 (including R2) except that there are three new data types (highlighted) in the 1.1 version of the schema used in SCSM. SCOM v.Next will pick up those new data types when it adopts the newest version of the common MP schema.
Each data type value results in a column being created in a SQL Server database table. That column in the SQL Server database table has to be of a SQL Server data type. This is how the mapping works:
MP Schema Data Type
SQL Server Column Data Type
PropertyType Value on the ManagedTypeProperty Table
Binary data and nvarchar with n > 4000 properties will not have their data moved to the DW in SCSM 2010. Do not use those data types if you want your data to show up in the DW and reports.
Use datetime for storing date/time property values.
Use bool for storing True/False values.
Depending on the size of the number you want to store, choose int, decimal, or double. Choose the smallest storage size possible given the range of numbers you expect. Keep in mind that even if the number you store is ‘1’, if you use double it will store it as 8 bytes. Avoid using decimal unless you really need that level of precision.
Use the smallest
that you know will fit your data. If not sure, err on the high side.
Use binary data type for storing big chunks of data like file attachments, images, binary blobs, etc.
Use GUID for easily storing unique ID values.
Use enum for those properties where the values that are allowed come from a predefined list of values. For more information on enums see this