insert into ManagedElementType ( IsSingleInstance, ME2CategoryID, ManagedElementGuidColumnName, ManagedElementTypeGuid, TableName, TypeName )
    select 1,6,'DeviceGuid','a61a2f73-b800-499f-a44a-126858320ad8','DeviceRegistryInfo','DeviceRegistryInfo'
    where not exists (select * from  ManagedElementType where  ManagedElementTypeGuid = 'a61a2f73-b800-499f-a44a-126858320ad8' )
GO

INSERT ManagedElementAttributeType
(AttributeName, DataType, IsArray, IsKey, IsPKMember, IsMonitored, ManagedElementAttributeTypeGuid, ManagedElementTypeGuid, SqlDataType, [DataLength], UnitOfMeasure, IsIdentity)
    SELECT 'ReleaseId','System.String',0,0,0,1,'7783D27A-FC51-45BF-BA7D-69986991FCB8','A61A2F73-B800-499F-A44A-126858320AD8','nvarchar(1000)',NULL,NULL,0                   
     WHERE NOT EXISTS (SELECT * FROM  ManagedElementAttributeType where  ManagedElementAttributeTypeGuid = '7783D27A-FC51-45BF-BA7D-69986991FCB8' )
GO

INSERT ManagedElementAttributeType
(AttributeName, DataType, IsArray, IsKey, IsPKMember, IsMonitored, ManagedElementAttributeTypeGuid, ManagedElementTypeGuid, SqlDataType, [DataLength], UnitOfMeasure, IsIdentity)
    SELECT 'UpdateBuildRevision','System.UInt16',0,0,0,1,'1C2C3512-8898-4A97-BC7A-769C4B4DD471','A61A2F73-B800-499F-A44A-126858320AD8','int',NULL,NULL,0                   
     WHERE NOT EXISTS (SELECT * FROM  ManagedElementAttributeType where  ManagedElementAttributeTypeGuid = '1C2C3512-8898-4A97-BC7A-769C4B4DD471' )
GO

INSERT ManagedElementAttributeType
(AttributeName, DataType, IsArray, IsKey, IsPKMember, IsMonitored, ManagedElementAttributeTypeGuid, ManagedElementTypeGuid, SqlDataType, [DataLength], UnitOfMeasure, IsIdentity)
    SELECT 'InstallationType','System.String',0,0,0,1,'9BD545CC-90AE-4A91-A3FD-9A8848CA4629','A61A2F73-B800-499F-A44A-126858320AD8','nvarchar(1000)',NULL,NULL,0                   
     WHERE NOT EXISTS (SELECT * FROM  ManagedElementAttributeType where  ManagedElementAttributeTypeGuid = '9BD545CC-90AE-4A91-A3FD-9A8848CA4629' )
GO