SELECT *
,rm.Code
FROM UserRoleXNode urn
INNER JOIN UserXRole ur ON urn.UserRoleId = ur.Id
INNER JOIN RoleMaster rm ON ur.RoleId = rm.Id
AND rm.Code <> 'ADMIN'
WHERE urn.NodeId in (15,17,16,14,7)
AND urn.IsActive = 1
UPDATE urn
SET urn.IsActive = 0
FROM UserRoleXNode urn
INNER JOIN UserXRole ur ON urn.UserRoleId = ur.Id
INNER JOIN RoleMaster rm ON ur.RoleId = rm.Id
AND rm.Code <> 'ADMIN'
WHERE urn.NodeId in (15,17,16,14,7)
AND urn.IsActive = 1