
[dbo].[ARG_RECONCILE_DISC_VIEW]
CREATE VIEW ARG_RECONCILE_DISC_VIEW
AS
SELECT dh.dis_hw_uuid,
dh.host_name as discovery_asset_name,
dh.serial_number as dis_asset_serial_num,
dh.primary_mac_address,
dh.asset_tag as bios_asset_tag,
dh.label,
dh.vendor_name as sys_vendor,
dh.tenant_id as dis_tenant_uuid,
ap.genModel as sys_model,
ap.genType as sys_type,
ap.genNetName as dis_dns_name,
ap.genRegAsset as registry_asset_name,
ap.genBatchID as batch_id,
CASE
WHEN LTRIM(dh.primary_mac_address) is null OR LEN(LTRIM(dh.primary_mac_address)) = 0
THEN dh.host_name
ELSE dh.primary_mac_address+' '+dh.host_name
END as dis_mac_host
FROM ca_discovered_hardware dh
INNER JOIN ca_agent_prop ap
ON ap.object_uuid = dh.dis_hw_uuid
GO