If you are not already familiar with modeling concepts please see this blog post first:
http://blogs.technet.com/b/servicemanager/archive/2010/04/05/modeling-in-system-center-service-...
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:
<xsi:simpleType name="ManagementPackEntityPropertyTypes">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:
|
|
PropertyType Value on the ManagedTypeProperty Table |
|
int | int | 0 |
-2^31 (-2,147,483,648) to 2^31-1 (2,147,483,647) 4 bytes |
decimal | decimal | 1 |
Precision: 38
|
double | float | 2 |
- 1.79E+308 to -2.23E-308 ,0, and 2.23E-308 to 1.79E+308 Precision: 53 8 bytes |
string | nvarchar(n) | 3 |
n = the value of the MaxLength attribute defined on the Property element.
Default n = 256 Max: the maximum storage size is 2^31-1 bytes Special note: values of any property that has n > 4000 will not be copied to the data warehouse. |
datetime | datetime | 4 |
Precision: 23
8 bytes |
guid | uniqueidentifier | 5 | 16 bytes |
bool | bit | 6 |
1 = TRUE
0 = FALSE <1 byte |
enum | uniqueidentifier | 7 |
Stores a GUID which is effectively a foreign key from the EnumType table and represents the currently selected EnumerationValue (aka “List Item”)
16 bytes |
richtext | nvarchar(n) | 8 |
n = the value of the MaxLength attribute defined on the Property element.
Default n = 256 Special note: values of any property that has n > 4000 will not be copied to the data warehouse. Special note: use this data type to store property values which are in RTF format. |
binary | uniqueidentifier is a foreign key to a table that has a varbinary(max) field to store the binary data | 9 |
varbinary(max) stores up to 2^31-1 bytes
16 bytes for the GUID FK |
Some best practices:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.