I ran this script and received the following errors:
Msg 170, Level 15, State 1, Line 71
Line 71: Incorrect syntax near 'max'.
Msg 156, Level 15, State 1, Line 87
Incorrect syntax near the keyword 'from'.
not sure where the sys.dm_server_services is
What database should this be running from and why is there an error for the varchar(max)?