IF OBJECT_ID('tempdb..#new')IS NOT NULL BEGIN;
	DROP TABLE #new;
END;

SELECT *
INTO #new
from master.sys.configurations

--except
IF OBJECT_ID('tempdb..#old')IS NOT NULL BEGIN;
	DROP TABLE #old;
END;

select *
INTO #old
from sunaps.master.sys.configurations

SELECT [y].[name],
       [y].[new_val],
       [y].[old_val],
       [y].[src]
FROM (
    SELECT [x].[name],
           [x].[new_val],
           [x].[old_val],
           [x].[src],
           ROW_NUMBER()OVER(PARTITION BY [x].[name] ORDER BY [x].[src]) AS rnk
    FROM (
        SELECT n.name, n.value AS new_val, o.[value] AS old_val, 'new' AS src
        FROM [#new] n
            LEFT JOIN [#old] o ON o.[name] = n.[name]
        WHERE ISNULL(n.[value],'new') <> ISNULL(o.[value], 'old')
        UNION 
        SELECT n.name, n.value AS new_val, o.[value] AS old_val, 'old'
        FROM [#old] o 
            LEFT JOIN [#new] n ON o.[name] = n.[name]
        WHERE ISNULL(n.[value],'new') <> ISNULL(o.[value], 'old')
    )x
)y
WHERE [y].[rnk] = 1
ORDER BY [y].[name]