Skip to main content

qds.spDeleteAssetId

Description

Deletes all QDS-related records associated with a given `assetId`. This includes links to check sheets, events, attribute tolerances, and data sources.

Parameters

- `@assetId` (int): ID of the asset to delete.

Key Operations

- Deletes from the following QDS tables: - `qds.chkShtAssetLink` - `qds.chkShtEvent` - `qds.attributeTolerance` - `qds.attributeDataSource` - Aggregates the number of rows deleted from each table.

Return Value

Returns the total number of rows deleted across all relevant tables.

Example

-- Delete QDS records for a specific asset
DECLARE @deletedRows INT;
EXEC @deletedRows = qds.spDeleteAssetId @assetId = 42;
SELECT @deletedRows AS DeletedRows;