In general, insulin is the preferred treatment for hyperglycemia in hospitalized patients previously treated with oral agents. However, there are some circumstances where insulin may not be necessary, it could maintain oral antidiabetic?
The reason insulin is preferred for inpatient care has to do with its ability to quickly and relatively more precisely control blood glucose level, given that the time for inpatient care is expensive and consequently limited.
For glucose lowering in the hospital insulin is certainly a preferable drug. However, if anti-inflammatory drugs are being used outside of the hospital (e.g. pioglitazone) with a more general impact on insulin resistance (and thus on insulin dose), there is no reason to stop them during a hospitalization period.
It really depends on the setting. Be aware that some oral antihyperglycemic drugs should be ceased in many acute settings (dehydration, gastroenteritis, septicaemia, renal failure, cardiac instabilities). In this settings most oral drugs should be used with caution (especially metformin and SGLT-2). So in unstable situations oral drugs are usually stopped at our clinic. However in other in-patient settings, for instance in the case of rheumatology, neurology or less severe internal medicine patients we frequently use or even add oral antihyperglycemic drugs.