Yes, you can switch from a visit to a residence visa or between different visa types without leaving the UAE.