mes.spAdminDeleteAssetWithHistory
Description
Recursively deletes an asset and its descendant hierarchy, along with all historical records including counters, events, and linked metadata across MES, SCH, SEC, and QDS schemas.Syntax
mes.spAdminDeleteAssetWithHistory @assetIdParameters:
@assetId (int): The root asset to delete, along with all descendants.
Returns:
int: Total number of rows deleted or updated across all affected tables.
Code Example
-- Delete an asset and all historical data
EXEC mes.spAdminDeleteAssetWithHistory @assetId = 2076;