IT Nota

  • Home
  • How To
  • .NET
  • WordPress
  • Contact

How to Link History Table in HP Asset Manager

If you use HP Asset Manager software (AM), at some point you may be asked to query historical records of an asset. As long as the field is configured to keep history, all changes are kept in the amHistory table along with the old and new values of the field, modified date, what table is affected, etc.

Hewlett-Packard Asset Manager amPortfolio Configure field - Keep history

The problem is amHistory table by itself is hardly useful without being linked to other tables where we usually start our search (i.e., machine’s serial number, person’s name, etc.). amHistory is linked to a table whenever Keep history: option is turned on on any field of that particular table. The trick is to understand how amHistory is linked to different tables within AM.

Since amHistory can be linked to any tables, it uses one field, LHISTOBJID to populate main Id from the linked tables. So anytime we want to link amHistory to a table such as amPortfolio for example, then need to get the main Id of amPortfolio’s table (i.e., LPORTFOLIOITEMID) and link it with LHISTOBJID. Similarly, if we want to join amHistory with amAsset table, we should use LASTID as the key to match to LHISTOBJID.

These two SQL examples below should be self-explanatory:

Joined with amPortfolio Table

SELECT * FROM amPortfolio p
INNER JOIN amHistory h
ON p.LPortfolioItemId = h.LHistObjId
WHERE p.AssetTag = 'SN1234';

Joined with amAsset Table

SELECT * FROM amAsset a
INNER JOIN amHistory h
ON a.LAstId = h.LHistObjId
WHERE a.AssetTag = 'SN1234';

Hope it helps.

March 20, 2013 Filed Under: How To Tagged With: HP Asset Manager, SQL

Buy me a coffee?

Buy me a coffee If you find any of the articles or demos helpful, please consider supporting my work here, you'll have my big thanks!

Buy me a coffee Support this site
Buy Me a Coffee?

Categories

  • .NET
  • Coding
  • Cybersecurity
  • Database
  • How To
  • Internet
  • Multimedia
  • Photography
  • Programming
  • Resources
  • Review
  • Tips and Tricks
  • Uncategorized
  • Use Case
  • WordPress
  • Writing

Recent Posts

  • How to View Stored Procedure Code in SQL Server
  • How to Find a String in SQL Server Stored Procedures
  • How to Remove Cached Credentials without Rebooting Windows
  • ESP Work Automation: Empowering Enterprises with Streamlined Workflows and Operational Efficiency
  • How to Search for a String in All Tables in a Database

Recent Posts

  • How to View Stored Procedure Code in SQL Server
  • How to Find a String in SQL Server Stored Procedures
  • How to Remove Cached Credentials without Rebooting Windows
  • ESP Work Automation: Empowering Enterprises with Streamlined Workflows and Operational Efficiency
  • How to Search for a String in All Tables in a Database

Tags

.NET .NET Core AdSense ASP.NET Cdonts Dll Classic ASP Code Editor ETL FSharp Genesis Framework Git Google HP Asset Manager HTML5 Hugo IIS Information Security Internet Internet Information Services iOS JAMStack Linux macOS Microsoft Microsoft SQL Server MVC PHP PowerShell Python Simple Mail Transfer Protocol Smtp Server SQL SQL Server SSIS SSMS SSRS Sublime Text Visual Studio Visual Studio Code VPN Windows Windows 8 Windows 10 Windows 2012 Windows Server

Copyright © 2011-2025 IT Nota. All rights reserved. Terms of Use | Privacy Policy | Disclosure