insert into ManagedElementType ( IsSingleInstance, ME2CategoryID, ManagedElementGuidColumnName, ManagedElementTypeGuid, TableName, TypeName )
    select 1,6,'DeviceGuid','92A1F7F3-8158-445C-A21D-42821F3C5703','Asset_IBUAgent','IBUAgent'
    where not exists (select * from  ManagedElementType where  ManagedElementTypeGuid = '92A1F7F3-8158-445C-A21D-42821F3C5703' )
GO

INSERT ManagedElementAttributeType
(AttributeName, DataType, IsArray, IsKey, IsPKMember, IsMonitored, ManagedElementAttributeTypeGuid, ManagedElementTypeGuid, SqlDataType, [DataLength], UnitOfMeasure, IsIdentity)
    SELECT 'UserName','System.String',0,0,0,1,'41C696AD-280E-4E66-94F4-F05D397CAE4F','92A1F7F3-8158-445C-A21D-42821F3C5703','nvarchar(50)',NULL,NULL,0                   
     WHERE NOT EXISTS (SELECT * FROM  ManagedElementAttributeType where  ManagedElementAttributeTypeGuid = '41C696AD-280E-4E66-94F4-F05D397CAE4F' )
GO

INSERT ManagedElementAttributeType
(AttributeName, DataType, IsArray, IsKey, IsPKMember, IsMonitored, ManagedElementAttributeTypeGuid, ManagedElementTypeGuid, SqlDataType, [DataLength], UnitOfMeasure, IsIdentity)
    SELECT 'ComputerID','System.String',0,0,0,1,'4270BBB1-D5B9-4DED-9EE8-133F027370CD','92A1F7F3-8158-445C-A21D-42821F3C5703','char(4)',NULL,NULL,0                   
     WHERE NOT EXISTS (SELECT * FROM  ManagedElementAttributeType where  ManagedElementAttributeTypeGuid = '4270BBB1-D5B9-4DED-9EE8-133F027370CD' )
GO

INSERT ManagedElementAttributeType
(AttributeName, DataType, IsArray, IsKey, IsPKMember, IsMonitored, ManagedElementAttributeTypeGuid, ManagedElementTypeGuid, SqlDataType, [DataLength], UnitOfMeasure, IsIdentity)
    SELECT 'AgentVersion','System.String',0,0,0,1,'2B35FBB3-9975-4778-B452-071FC343DC8A','92A1F7F3-8158-445C-A21D-42821F3C5703','nvarchar(50)',NULL,NULL,0                   
     WHERE NOT EXISTS (SELECT * FROM  ManagedElementAttributeType where  ManagedElementAttributeTypeGuid = '2B35FBB3-9975-4778-B452-071FC343DC8A' )
GO