Ниже запрос поможет вам получить результат.
SELECT
oldvalue.ID
,oldvalue.tablename
,oldvalue.Colname as fieldname
,oldvalue.ColValue as oldvalue
,newvalue.ColValue as newvalue
FROM
(
SELECT
q.ID,
t.p.value('local-name(.)', 'varchar(50)') as Colname,
t.p.value('(.)[1]', 'varchar(50)') as ColValue,
t.p.value('local-name(..)[1]', 'varchar(50)') as tablename
FROM #test q
CROSS APPLY oldvalue.nodes('/Root/ScreenrightsManagement/*') t(p)
)oldvalue
inner join
(
SELECT
q.ID,
t.p.value('local-name(.)', 'varchar(50)') as Colname,
t.p.value('(.)[1]', 'varchar(50)') as ColValue,
t.p.value('local-name(..)[1]', 'varchar(50)') as tablename
FROM #test q
CROSS APPLY newvalue.nodes('/Root/ScreenrightsManagement/*') t(p)
)newvalue ON newvalue.Id=oldvalue.Id and newvalue.Colname=oldvalue.Colname
and newvalue.tablename=oldvalue.tablename