Skip to main content

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 @assetId

Parameters:
@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;