Job step:
SSIS Server Max Version Per Project Maintenance
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 |
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] |