update A set a.name = 'testName'
from A a
join b on a.id = b.destId
join c on b.destId = c.sourceId
where a.id > 0 and c.name = 'test'
delete a from A a
join b on a.id = b.destId
join c on b.cid = c.id
where c.name = 'tets'
update A set a.name = 'testName'
from A a
join b on a.id = b.destId
join c on b.destId = c.sourceId
where a.id > 0 and c.name = 'test'
delete a from A a
join b on a.id = b.destId
join c on b.cid = c.id
where c.name = 'tets'