/*
	701 SupportAssistant START 

select 
'INSERT [ManagedElementAttributeType] ([ManagedElementAttributeTypeGuid], [ManagedElementTypeGuid],[AttributeName], [IsKey], [IsMonitored], [DataType], [IsArray], [SqlDataType]) select ' 
        +        quotename( [ManagedElementAttributeTypeGuid]   ,'''')
        + ', ' + quotename( [ManagedElementTypeGuid]            ,'''')
        + ', ' + quotename( [AttributeName]                     ,'''') 
        + ', ' + cast( [IsKey]                  as varchar(50)) 
        + ', ' + cast( [IsMonitored]            as varchar(50)) 
        + ', ' + cast( [DataType]               as varchar(50)) 
        + ', ' + cast( [IsArray]                as varchar(50)) 
        + ', ' + quotename( [SqlDataType]                       ,'''') 
        + '
        where not exists (select * from [ManagedElementType] where [ManagedElementTypeGuid] = ' + quotename(ManagedElementAttributeTypeGuid,'''') + ')
from  
     ManagedElementAttributeType 


*/

INSERT [ManagedElementType] ([ManagedElementTypeGuid], [TypeName], [IsSingleInstance]) 
   select '7D8E5A11-AEDE-4782-92C8-E804180E0045', N'SupportAssistantProfile',1
   where not exists (select * from [ManagedElementType] where [ManagedElementTypeGuid] = '7D8E5A11-AEDE-4782-92C8-E804180E0045')
GO

go     
        
        
INSERT [ManagedElementAttributeType] ([ManagedElementAttributeTypeGuid], [ManagedElementTypeGuid],[AttributeName], [IsKey], [IsMonitored], [DataType], [IsArray], SqlDataType) 
 select '2FFD4268-D6C1-4154-B781-578B83531CE6', '7D8E5A11-AEDE-4782-92C8-E804180E0045', 'SaVersion', 1, 0, 'System.String', 0, 'nvarchar(MAX)'
where not exists (select * from [ManagedElementAttributeType] where [ManagedElementAttributeTypeGuid] = '2FFD4268-D6C1-4154-B781-578B83531CE6')
go

INSERT [ManagedElementAttributeType] ([ManagedElementAttributeTypeGuid], [ManagedElementTypeGuid],[AttributeName], [IsKey], [IsMonitored], [DataType], [IsArray], SqlDataType) 
 select 'D8059A14-81C0-49C2-B450-06AC14754049', '7D8E5A11-AEDE-4782-92C8-E804180E0045', 'InstallDate', 0, 0, 'System.DateTime', 0, 'datetime'
where not exists (select * from [ManagedElementAttributeType] where [ManagedElementAttributeTypeGuid] = 'D8059A14-81C0-49C2-B450-06AC14754049')
go

INSERT [ManagedElementAttributeType] ([ManagedElementAttributeTypeGuid], [ManagedElementTypeGuid],[AttributeName], [IsKey], [IsMonitored], [DataType], [IsArray], SqlDataType) 
 select 'C823B4A3-B728-44DB-8A57-819133B12492', '7D8E5A11-AEDE-4782-92C8-E804180E0045', 'InstallDateTicks', 0, 0, 'System.DateTime', 0, 'datetime'
where not exists (select * from [ManagedElementAttributeType] where [ManagedElementAttributeTypeGuid] = 'C823B4A3-B728-44DB-8A57-819133B12492')
go

INSERT [ManagedElementAttributeType] ([ManagedElementAttributeTypeGuid], [ManagedElementTypeGuid],[AttributeName], [IsKey], [IsMonitored], [DataType], [IsArray], SqlDataType) 
 select '96C1B56A-EAB8-422A-A232-CF7CC2EEBE2A', '7D8E5A11-AEDE-4782-92C8-E804180E0045', 'InitialInstallDate', 0, 0, 'System.DateTime', 0, 'datetime'
where not exists (select * from [ManagedElementAttributeType] where [ManagedElementAttributeTypeGuid] = '96C1B56A-EAB8-422A-A232-CF7CC2EEBE2A')
go

INSERT [ManagedElementAttributeType] ([ManagedElementAttributeTypeGuid], [ManagedElementTypeGuid],[AttributeName], [IsKey], [IsMonitored], [DataType], [IsArray], SqlDataType) 
 select 'E1C1E8C9-50DD-4E9D-BBFC-1E09264DBEC9', '7D8E5A11-AEDE-4782-92C8-E804180E0045', 'InitialInstallDateTicks', 0, 0, 'System.DateTime', 0, 'datetime'
where not exists (select * from [ManagedElementAttributeType] where [ManagedElementAttributeTypeGuid] = 'E1C1E8C9-50DD-4E9D-BBFC-1E09264DBEC9')
go


INSERT [ManagedElementAttributeType] ([ManagedElementAttributeTypeGuid], [ManagedElementTypeGuid],[AttributeName], [IsKey], [IsMonitored], [DataType], [IsArray], SqlDataType) 
 select '27DE8DE9-832E-4FEE-A019-F0253E0E2BF7', '7D8E5A11-AEDE-4782-92C8-E804180E0045', 'ProfileId', 0, 0, 'System.UInt64', 0, 'bigint'
where not exists (select * from [ManagedElementAttributeType] where [ManagedElementAttributeTypeGuid] = '27DE8DE9-832E-4FEE-A019-F0253E0E2BF7')
go

INSERT [ManagedElementAttributeType] ([ManagedElementAttributeTypeGuid], [ManagedElementTypeGuid],[AttributeName], [IsKey], [IsMonitored], [DataType], [IsArray], SqlDataType) 
 select '2119A0E2-E6F9-4DD3-9CB6-7FCC7337072B', '7D8E5A11-AEDE-4782-92C8-E804180E0045', 'ProfileSyncGuid', 0, 0, 'System.Guid', 0, 'uniqueidentifier'
where not exists (select * from [ManagedElementAttributeType] where [ManagedElementAttributeTypeGuid] = '2119A0E2-E6F9-4DD3-9CB6-7FCC7337072B')
go


INSERT [ManagedElementAttributeType] ([ManagedElementAttributeTypeGuid], [ManagedElementTypeGuid],[AttributeName], [IsKey], [IsMonitored], [DataType], [IsArray], SqlDataType) 
 select '695F4760-4226-45BA-B49A-8FFF2FCC82CB', '7D8E5A11-AEDE-4782-92C8-E804180E0045', 'ScUrl', 0, 0, 'System.String', 0, 'nvarchar(MAX)'
where not exists (select * from [ManagedElementAttributeType] where [ManagedElementAttributeTypeGuid] = '695F4760-4226-45BA-B49A-8FFF2FCC82CB')

go

INSERT [ManagedElementAttributeType] ([ManagedElementAttributeTypeGuid], [ManagedElementTypeGuid],[AttributeName], [IsKey], [IsMonitored], [DataType], [IsArray], SqlDataType) 
 select '4CEA18A1-B690-47B5-8D8C-085D688E0AF1', '7D8E5A11-AEDE-4782-92C8-E804180E0045', 'ScMessagingUrl', 0, 0, 'System.String', 0, 'nvarchar(MAX)'
where not exists (select * from [ManagedElementAttributeType] where [ManagedElementAttributeTypeGuid] = '4CEA18A1-B690-47B5-8D8C-085D688E0AF1')
go

INSERT [ManagedElementAttributeType] ([ManagedElementAttributeTypeGuid], [ManagedElementTypeGuid],[AttributeName], [IsKey], [IsMonitored], [DataType], [IsArray], SqlDataType) 
 select '9804FFED-0F49-44E6-AC42-D506CDD4E78E', '7D8E5A11-AEDE-4782-92C8-E804180E0045', 'CustomerGuid', 0, 0, 'System.Guid', 0, 'uniqueidentifier'
where not exists (select * from [ManagedElementAttributeType] where [ManagedElementAttributeTypeGuid] = '9804FFED-0F49-44E6-AC42-D506CDD4E78E')
go


        
