/******** Cleanup ****************
DELETE FROM DATABASES_2_COLLECT
WHERE SERVER_NAME = 'SQL_NAME_HERE' <== Field SERVER_NAME doesnt exist in DATABASES_2_COLLECT table
DELETE FROM QUERY_ALERTS_CONFIG] <== Unbalance brackets
WHERE SERVER_NAME = 'SQL_NAME_HERE'
**********************************/
Correct statements should be:
DELETE FROM DATABASES_2_COLLECT
WHERE LINKED_SERVER = 'SQL_NAME_HERE'
DELETE FROM QUERY_ALERTS_CONFIG
WHERE SERVER_NAME = 'SQL_NAME_HERE
From 4-ConfigureDBs to Collect.sql, line 73:
Correct statements should be: