Gastric bypass surgery has been proposed as an effective treatment strategy for type 2 diabetes mellitus (T2DM), but thus far algorithms for the management of T2DM immediately after surgery have not been established. The investigators designed an algorithm to achieve good glycaemic control in patients with insulin-requiring T2DM upon discharge after gastric bypass surgery, and evaluated this algorithm for feasibility, efficacy, and safety.