Job step: SSIS Server Max Version Per Project Maintenance

CollapseAll image

Collapse image Job step properties


 Id   Name 
Name SSIS Server Max Version Per Project Maintenance
ID 2
Type TSQL
Run as user  
Database msdb
On success action 1 (quit with success)
Retry attempts 3
Retry interval(minutes) 3
On fail action 2 (quit with failure)
Output file  

Collapse image Command



    DECLARE @role int
    SET @role = (SELECT [role] FROM [sys].[dm_hadr_availability_replica_states] hars INNER JOIN [sys].[availability_databases_cluster] adc ON hars.[group_id] = adc.[group_id] WHERE hars.[is_local] = 1 AND adc.[database_name] ='SSISDB')
    IF DB_ID('SSISDB') IS NOT NULL AND (@role IS NULL OR @role = 1)
        EXEC [SSISDB].[internal].[cleanup_server_project_version]

Collapse image See also


[SSIS Server Maintenance Job]