update ea
set SystemType=e.[Schema]+'.'+e.EntName
from VCLib.T_ENTITY_ATTRIBUTES ea
join VCLib.T_ENTITIES e on e.EntName = ea.SystemType
where ea.AttributeType = 1 or ea.AttributeType = 2

update ea
set SystemType=e.[Schema]+'.'+e.EntName
from VCLib.T_ENTITY_ATTRIBUTES ea
join VCLib.T_ADDITIONAL_ENTITIES e on e.EntName = ea.SystemType
where ea.AttributeType = 1 or ea.AttributeType = 2

update ea
set ea.EntName=e.[Schema]+'.'+e.EntName
from dbo.T_ENTITY_IDS ea
join VCLib.T_ENTITIES e on e.EntName = ea.EntName

update ea
set ea.EntName=e.[Schema]+'.'+e.EntName
from dbo.T_ENTITY_IDS ea
join VCLib.T_ADDITIONAL_ENTITIES e on e.EntName = ea.EntName