Index Maintenance with Ola starting from day x (7 or 9) till the end of month I want to run the index maintenance from Ola daily, but in my company the firsts business days every month I can't, cause heavy application usage during the night.

So I want to run Ola's script only from the 7 till the end of the month.

How can I to this?

In my script I handle it with a simple if:

if 
datepart(dd,getdate()) &lt; 7 return
else begin


But how can I do this with Ola's script?

Best regards
Guenter
I wouldn't recommend making changes directly to Ola's script for your situation.  Any customization you make to his scripts will be lost when you download a newer version sometime in the future.

Instead, create a SQL Server Agent job to run daily and put your conditional execution logic in the job step

if datepart(day,getdate()) &gt; 7 
    EXECUTE dbo.IndexOptimize