
-- Convert Win32_Environment as a concrete table UPDATE ManagedElementType
UPDATE  ManagedElementType
SET TableName = 'Asset_Win32_Environment'
	,ManagedElementGuidColumnName = 'Win32_EnvironmentGuid'
	,ME2CategoryID = 6
WHERE ManagedElementTypeGuid = '7A455641-0D9B-4204-857D-585137D4F243'

GO
-- Update attribute type for Win32_Environment
UPDATE ManagedElementAttributeType SET SqlDataType = 'nvarchar(500)'  WHERE AttributeName = 'Caption' AND ManagedElementAttributeTypeGuid = 'A50C4497-86A8-4839-A7C8-B402BEFE41EF'
GO
UPDATE ManagedElementAttributeType SET SqlDataType = 'nvarchar(2000)'  WHERE AttributeName = 'Description' AND ManagedElementAttributeTypeGuid = '3819003C-EE4C-4947-BA82-3490E3B59FF0'
GO
UPDATE ManagedElementAttributeType SET SqlDataType = 'nvarchar(1000)'  WHERE AttributeName = 'Name' AND ManagedElementAttributeTypeGuid = '560DB496-4170-404B-A9F8-B84E8765C925'
GO
UPDATE ManagedElementAttributeType SET SqlDataType = 'nvarchar(1000)'  WHERE AttributeName = 'Status' AND ManagedElementAttributeTypeGuid = 'D43F67DF-EA19-4FC8-9C78-88C52A089DCC'
GO
UPDATE ManagedElementAttributeType SET SqlDataType = 'nvarchar(1000)'  WHERE AttributeName = 'UserName' AND ManagedElementAttributeTypeGuid = 'CE6BE999-04FA-4D26-AF96-31020DE6F72E'
GO
UPDATE ManagedElementAttributeType SET SqlDataType = 'nvarchar(3000)'  WHERE AttributeName = 'VariableValue' AND ManagedElementAttributeTypeGuid = '7182B744-C32C-4E89-B459-463093E81E5B'
GO


-- Convert SMBios_Processor to a concrete table
UPDATE ManagedElementType
SET TableName = 'Asset_SMBios_Processor'
	,ManagedElementGuidColumnName = 'SMBios_ProcessorGuid'
	,ME2CategoryID = 6
WHERE ManagedElementTypeGuid = '9B45AB98-BA85-43EF-8E79-82B3FCDA7755'
GO


-- Convert SMBios_MemoryDevice to a concrete table

UPDATE ManagedElementType
SET TableName = 'Asset_SMBios_MemoryDevice'
	,ManagedElementGuidColumnName = 'SMBios_MemoryDeviceGuid'
	,ME2CategoryID = 6
WHERE ManagedElementTypeGuid = 'B954046B-8F41-454C-BB04-3552A8DA5BF6'
GO


-- Convert Win32_Printer to a concrete table
UPDATE ManagedElementType
SET TableName = 'Asset_Win32_Printer'
	,ManagedElementGuidColumnName = 'Win32_PrinterGuid'
	,ME2CategoryID = 6
WHERE ManagedElementTypeGuid = 'a5b54431-a5b8-4d35-9f11-6c7337ee47a6'
GO

-- update attribute types for Win32_Printer
UPDATE ManagedElementAttributeType SET SqlDataType = 'nvarchar(3000)'  WHERE AttributeName = 'AvailableJobSheets' AND ManagedElementAttributeTypeGuid = '3f38dd04-b70e-4550-b3cc-d9f82d643070'
GO
UPDATE ManagedElementAttributeType SET SqlDataType = 'nvarchar(3000)'  WHERE AttributeName = 'CapabilityDescriptions' AND ManagedElementAttributeTypeGuid = '891F0B01-314B-449D-818E-337D2EF325BF'
GO
UPDATE ManagedElementAttributeType SET SqlDataType = 'nvarchar(500)'  WHERE AttributeName = 'Caption' AND ManagedElementAttributeTypeGuid = '294E73D9-80C5-469D-A790-61888F7E3AE7'
GO
UPDATE ManagedElementAttributeType SET SqlDataType = 'nvarchar(3000)'  WHERE AttributeName = 'CharSetsSupported' AND ManagedElementAttributeTypeGuid = '362CD5BB-868E-4029-9252-26D602DE62FF'
GO
UPDATE ManagedElementAttributeType SET SqlDataType = 'nvarchar(1000)'  WHERE AttributeName = 'Comment' AND ManagedElementAttributeTypeGuid = 'C378EE42-4A16-4DF9-A53F-D8C969F1BFC9'
GO
UPDATE ManagedElementAttributeType SET SqlDataType = 'nvarchar(1000)'  WHERE AttributeName = 'CreationClassName' AND ManagedElementAttributeTypeGuid = 'D727D02A-647E-46C8-8B30-B32B7E6C9C23'
GO

UPDATE ManagedElementAttributeType SET SqlDataType = 'nvarchar(1000)'  WHERE AttributeName = 'CurrentCharSet' AND ManagedElementAttributeTypeGuid = '93AAC7CD-DEB2-4071-B6FD-D4A8D3CBFBF3'
GO

UPDATE ManagedElementAttributeType SET SqlDataType = 'nvarchar(1000)'  WHERE AttributeName = 'CurrentMimeType' AND ManagedElementAttributeTypeGuid = 'FE16E75A-A906-4F42-AB03-D4EF99AFDC08'
GO
UPDATE ManagedElementAttributeType SET SqlDataType = 'nvarchar(1000)'  WHERE AttributeName = 'CurrentNaturalLanguage' AND ManagedElementAttributeTypeGuid = 'EA45F46F-DF60-4CC3-B197-25602F4F6354'
GO
UPDATE ManagedElementAttributeType SET SqlDataType = 'nvarchar(1000)'  WHERE AttributeName = 'CurrentPaperType' AND ManagedElementAttributeTypeGuid = '3282FB16-E509-4228-9AA7-6E39A4ACFFF0'
GO
UPDATE ManagedElementAttributeType SET SqlDataType = 'nvarchar(1000)'  WHERE AttributeName = 'DefaultMimeType' AND ManagedElementAttributeTypeGuid = '01B84F8D-61F6-4CF4-91EF-CC49760350CC'
GO

UPDATE ManagedElementAttributeType SET SqlDataType = 'nvarchar(1000)'  WHERE AttributeName = 'DefaultPaperType' AND ManagedElementAttributeTypeGuid = '5EBB787A-CA71-434F-AF7A-509DA5E9E374'
GO
UPDATE ManagedElementAttributeType SET SqlDataType = 'nvarchar(2000)'  WHERE AttributeName = 'Description' AND ManagedElementAttributeTypeGuid = 'EC1ED178-98C3-4F69-AC29-5637EF8E5829'
GO
UPDATE ManagedElementAttributeType SET SqlDataType = 'nvarchar(1000)'  WHERE AttributeName = 'DeviceID' AND ManagedElementAttributeTypeGuid = 'cb67818e-4d3a-4709-8589-1d884cc202ed'
GO
UPDATE ManagedElementAttributeType SET SqlDataType = 'nvarchar(1000)'  WHERE AttributeName = 'DriverName' AND ManagedElementAttributeTypeGuid = '8865cd71-742d-441a-b91b-970907fe9b90'
GO
UPDATE ManagedElementAttributeType SET SqlDataType = 'nvarchar(2000)'  WHERE AttributeName = 'ErrorDescription' AND ManagedElementAttributeTypeGuid = '0b5df6b0-20df-4fba-b6db-13c9ab842fe4'
GO
UPDATE ManagedElementAttributeType SET SqlDataType = 'nvarchar(3000)'  WHERE AttributeName = 'ErrorInformation' AND ManagedElementAttributeTypeGuid = '40aa79a8-0ae1-4e0a-8eaf-ce328e86a1e1'
GO


UPDATE ManagedElementAttributeType SET SqlDataType = 'nvarchar(1000)'  WHERE AttributeName = 'Location' AND ManagedElementAttributeTypeGuid = '0a072926-27fb-474a-be54-394589143e95'
GO

UPDATE ManagedElementAttributeType SET SqlDataType = 'nvarchar(3000)'  WHERE AttributeName = 'MimeTypesSupported' AND ManagedElementAttributeTypeGuid = '8dd9a6b2-ec50-4630-b135-b6f41993965e'
GO
UPDATE ManagedElementAttributeType SET SqlDataType = 'nvarchar(1000)'  WHERE AttributeName = 'Name' AND ManagedElementAttributeTypeGuid = 'bd1967e2-25c3-4b4c-97e1-c186c0a939b0'
GO
UPDATE ManagedElementAttributeType SET SqlDataType = 'nvarchar(3000)'  WHERE AttributeName = 'NaturalLanguagesSupported' AND ManagedElementAttributeTypeGuid = 'bcfa9cdd-07b4-4625-9493-703733b6c619'
GO
UPDATE ManagedElementAttributeType SET SqlDataType = 'nvarchar(3000)'  WHERE AttributeName = 'PaperTypesAvailable' AND ManagedElementAttributeTypeGuid = 'fd66cf8b-9339-4d7c-9131-149e55c5862f'
GO
UPDATE ManagedElementAttributeType SET SqlDataType = 'nvarchar(1000)'  WHERE AttributeName = 'Parameters' AND ManagedElementAttributeTypeGuid = '54062a3e-2e41-425b-93f7-b7ab2252a8ff'
GO
UPDATE ManagedElementAttributeType SET SqlDataType = 'nvarchar(1000)'  WHERE AttributeName = 'PNPDeviceID' AND ManagedElementAttributeTypeGuid = '4b963d48-723d-4c37-a0b2-95ff432658b5'
GO

UPDATE ManagedElementAttributeType SET SqlDataType = 'nvarchar(1000)'  WHERE AttributeName = 'PortName' AND ManagedElementAttributeTypeGuid = 'f1b3ac4f-ba3b-4203-8bdf-8f6b28bf1187'
GO
UPDATE ManagedElementAttributeType SET SqlDataType = 'nvarchar(1000)'  WHERE AttributeName = 'PrinterPaperNames' AND ManagedElementAttributeTypeGuid = '8e00e148-8488-41db-911b-71c95e646810'
GO
UPDATE ManagedElementAttributeType SET SqlDataType = 'nvarchar(1000)'  WHERE AttributeName = 'PrintJobDataType' AND ManagedElementAttributeTypeGuid = '5b7eefcd-d246-4f5c-a88b-adaf368422d6'
GO
UPDATE ManagedElementAttributeType SET SqlDataType = 'nvarchar(1000)'  WHERE AttributeName = 'PrintProcessor' AND ManagedElementAttributeTypeGuid = 'fb1b0689-5f1e-4d7c-947c-0839c591cabe'
GO
UPDATE ManagedElementAttributeType SET SqlDataType = 'nvarchar(1000)'  WHERE AttributeName = 'SeparatorFile' AND ManagedElementAttributeTypeGuid = '20f6a16b-01b4-4a35-b15b-5a088428eb20'
GO
UPDATE ManagedElementAttributeType SET SqlDataType = 'nvarchar(1000)'  WHERE AttributeName = 'ServerName' AND ManagedElementAttributeTypeGuid = '052a623b-0aba-4536-9729-5748419c2ed3'
GO
UPDATE ManagedElementAttributeType SET SqlDataType = 'nvarchar(1000)'  WHERE AttributeName = 'ShareName' AND ManagedElementAttributeTypeGuid = '293d5608-2b26-4b02-b6b5-92fceeadec91'
GO
UPDATE ManagedElementAttributeType SET SqlDataType = 'nvarchar(1000)'  WHERE AttributeName = 'Status' AND ManagedElementAttributeTypeGuid = 'd80a724d-2998-4db2-8756-1f471b5cad67'
GO
UPDATE ManagedElementAttributeType SET SqlDataType = 'nvarchar(1000)'  WHERE AttributeName = 'SystemCreationClassName' AND ManagedElementAttributeTypeGuid = '19b2cb45-ec5a-4c41-8e52-a3b8ca120b16'
GO
UPDATE ManagedElementAttributeType SET SqlDataType = 'nvarchar(1000)'  WHERE AttributeName = 'SystemName' AND ManagedElementAttributeTypeGuid = '2adbcd61-f1ad-4559-aa36-08dd3cdcc575'
GO
