HP Device Manager 4.5 - Database Schema Guide
64
Generate all device inventory information
We need a device’s inventory information, so we will need to join the dm_devices table and other inventory
tables to get the desired information.
1. Locate the
dm_devices table and the inventory-related tables.
2. Write the SQL statements:
Use left join to connect all the tables you need (you just “left join” the table you need, and it will
generate the related results):
-- You can replace the "*" with specified columns you care about
select * from DB_NAME.dbo.dm_devices
-- append hardware information
left join DB_NAME.dbo.dm_inv_hardware
on dm_devices.device_id = dm_inv_hardware.device_id
-- append software information
left join DB_NAME.dbo.dm_inv_software
on dm_devices.device_id = dm_inv_software.device_id
-- append ewf information
left join DB_NAME.dbo.dm_inv_ewf
on dm_devices.device_id = dm_inv_ewf.device_id
-- append display information
left join DB_NAME.dbo.dm_inv_display
on dm_devices.device_id = dm_inv_display.device_id
-- … (you can keep appending the table)
-- If you want devices with specified device ID information, you can add a “where” clause:
where dm_devices.device_id = "xxxxx";
3. The results should be as shown below: