Use MainDataBase

Update MainDataBase.dbo.SprVid SET KodVED =
(Select KodVED FROM kodVed.dbo.sprvid t1
WHERE t1.KodVid = MainDataBase.dbo.SprVid.KodVid
AND t1.KodPGr = MainDataBase.dbo.SprVid.KodPGr
AND t1.KodGr = MainDataBase.dbo.SprVid.KodGr)