Here’s how you can quickly (with using the GUI or Excel Add-in) truncate an Entity-table in MDS by using the accompanied Staging-table (stg_*):
MDS needs the Code-ids together with the ImportType = 4 to delete records via staging.
Basically the first step is to populate the staging table by using the MDS view (which contains the current set of records and thus the Code-ids), after that you’ll need to execute the accompanied MDS stored procedure to process these changes.
Important: make sure that both BatchTag’s are identical!
Here’s the T-SQL code:
TRUNCATE TABLE stg.[TableName_Leaf]
INSERT INTO stg.[TableName_Leaf] (ImportType,ImportStatus_ID,BatchTag,Code)
4 AS ImportType
,0 AS ImportStatus_ID
,'Delete-20151102' AS BatchTag
SELECT * FROM stg.[TableName_Leaf]
EXEC stg.[udp_TableName_Leaf] @VersionName = 'VERSION_1', @LogFlag = 0, @BatchTag = 'Delete-20151102'
More info about working with MDS staging tables (and ETL):