[SQL Server] Supprimer le contenu de la table [SSISDB].[internal].[operation_messages]
/******* Première Solution ****************/
ALTERDATABASE [SSISDB] SETRECOVERYSIMPLE
GO
--Pour valider le mode de recouvrement il faut lancer un backup FULL
BACKUPDATABASE [SSISDB] TODISK=N'\\MesBackupSQL\SSISDB_FULL_20200922_141154.bak'
WITHNOFORMAT,NOINIT,NAME=N'SSISDB-BackupFULL',SKIP,NOREWIND,NOUNLOAD,STATS= 10
GO
WHILEEXISTS(SELECTTOP (20)PERCENT operation_id FROM [SSISDB].[internal].[operation_messages] WHERE operation_id=146066)
BEGIN
DELETETOP (20)PERCENTFROM [SSISDB].[internal].[operation_messages]
WHERE operation_id=146066
END
ALTERDATABASE [SSISDB] SETRECOVERYFULL
GO
--Pour valider le mode de recouvrement il faut lancer un backup FULL
BACKUPDATABASE [SSISDB] TODISK=N'\\MesBackupSQL\SSISDB_FULL_20200922_141154.bak'
WITHNOFORMAT,NOINIT,NAME=N'SSISDB-BackupFULL',SKIP,NOREWIND,NOUNLOAD,STATS= 10
GO
/******* Deixième Solution ****************/
WHILEEXISTS(SELECTTOP (20)PERCENT operation_id FROM [SSISDB].[internal].[operation_messages] WHERE operation_id=146066)
BEGIN
BACKUPLOG [SSISDB] TODISK=N'\\MesBackupSQL\SSISDB_FULL_20200922_141154.trn'
WITHNOFORMAT,NOINIT,NAME=N'SSISDB-BackupLOG',SKIP,NOREWIND,NOUNLOAD,STATS= 10
DBCC SHRINKFILE(N'log', 1)
DELETETOP (20)PERCENTFROM [SSISDB].[internal].[operation_messages]
WHERE operation_id=146066
END