I need to script toi set MAXDOP.
----I have this script----
select cpu_count,
case
when cpu_count/hyperthread_ratio >8 then 8
else cpu_count/hyperthread_ratio
end as optimal_maxdop_setting
from sys.dm_os_sys_info
I need script to setup maxdop by using optimal_maxdop_setting output above
I do not want to take output above and plug on the query below,
sp_configure 'show advanced options', 1;
GO
RECONFIGURE WITH OVERRIDE;
GO
sp_configure 'max degree of parallelism', <OutPut of the above script>;
GO
RECONFIGURE WITH OVERRIDE;