Solutions
...
Litmus Production Record Datab...
Interacting with Litmus Produc...

Purging production record data for a specific data model

6min

Use Cases

It might be necessary for users to remove an individual data model from the database, if they for example discontinue to use it or other circumstance make it obsolete.

This also requires to purge all associated production record data.

Otherwise data without a context would exist in the database.

User can purge all production record data for a specific data models, which will include all the ID's.

User can do this either by using applications such as:

  • Microsoft SQL Server Management Studio
  • MSSQL CLI

This can also be used for building custom solutions based on applications which allow for an ODBC connection such as:

  • Excel
  • C#
  • .Net
  • Python

Method

Execute Stored Procedure PROREC_Misc_ProcessData_Purge_Records_by_NodeID

Input Variables

Variable name

Datatype

Description

Example

@Node

VARCHAR(50)

The name of the root Node and the name of the data model. Mandatory!

Can not be NULL or Empty

Tooling_Shop_Status











How to use

To purge all production record data for a specific data model, call the stored procedure PROREC_Misc_ProcessData_Purge_Records_by_NodeID using the T-SQL EXEC or EXECUTE keyword and provide the Input variables. Below is an example using T-SQL in SQL Server Management Studio:

EXECUTE [LE_ProductionRecord].[dbo].[PROREC_Misc_ProcessData_Purge_Records_by_NodeID] @Node = N'Tooling_Shop_Status';

Note: The system will always create a backup first before purging. This way, the production record data can always be restored.

If an output window does exist, the progress can be observed.

production record data purge for specific data model
production record data purge for specific data model


Result

The stored procedure will verify that the provided values are correct and data exist. Then it will create the backup before purging the production record data.

The result can be read back from the log table PROREC_Misc_Log.

Below is an example using T-SQL in SQL Server Management Studio:

SELECT TOP (100) [LogID] ,[LogType] ,[LogProcedure] ,[LogEntry] ,[LogTime] FROM [LE_ProductionRecord].[dbo].[PROREC_Misc_Log] WHERE [LogProcedure] = 'PROREC_Misc_ProcessData_Purge_Records_by_NodeID' Order by LogID Desc;

With the result returned

log entry for production record data for specific data model purge
log entry for production record data for specific data model purge