yochananrachamim / AzureSQL

129 stars 61 forks source link

AzureSQLMaintenance script doesn't default mode when explicitly passed NULL #43

Open asos-richardevans opened 1 week ago

asos-richardevans commented 1 week ago

When explicitly passing the @mode parameter as NULL to the AzureSQLMaintenance stored procedure the protection that sets the mode to 'smart' as a default doesn't get executed.

Proposing that the code on line 63 is changed from

if @mode not in ('smart','dummy') set @mode = 'smart'

to

if (@mode not in ('smart','dummy') OR @mode IS NULL) set @mode = 'smart'