Postoperative hyperglycemia has been associated with poor surgical outcome. The effect of intraoperative glucose management on postoperative glucose levels and the optimal glycemic threshold for initiating insulin are currently unknown. We performed a retrospective cohort study of surgery patients who required intraoperative glucose management with data extracted from electronic medical records. In patients who required glucose management, intraoperative glucose levels and insulin therapy were compared against postoperative glucose levels during 3 periods: first postoperative level within 1 hour, within the first 12 hours, and 24 hours of the postoperative period. Logistic regression models that adjusted for patient and surgical factors were used to determine the association between intraoperative glucose management and postoperative glucose levels. In 2440 patients who required intraoperative glucose management, an increase in mean intraoperative glucose level by 10 mg/dL was associated with an increase in postoperative glucose levels by 4.7 mg/dL (confidence interval [CI], 4.1-5.3; P < 0.001) for the first postoperative glucose measurement, 2.6 mg/dL (CI, 2.1-3.1; P < 0.001) for the mean first 12-hour postoperative glucose, and 2.4 mg/dL (CI, 2.0-2.9; P < 0.001) for the mean first 24-hour postoperative glucose levels (univariate analysis). Multivariate analysis showed that these effects depended on (interacted with) body mass index and diabetes status of the patient. Both diabetes status (regression coefficient = 12.2; P < 0.001) and intraoperative steroid use (regression coefficient = 10.2; P < 0.001) had a positive effect on elevated postoperative glucose levels. Intraoperative hyperglycemia (>180 mg/dL) was associated with postoperative hyperglycemia during the first 12 hours and the first 24 hours. However, interaction with procedure duration meant that this association was stronger for shorter surgeries. When compared with starting insulin for an intraoperative glucose threshold of 140 mg/dL thus avoiding hyperglycemia, initiation of insulin for a hyperglycemia threshold of 180 mg/dL was associated with an increase in postoperative glucose level (7 mg/dL; P < 0.001) and postoperative hyperglycemia incidence (odds ratio = 1.53; P = 0.01). A higher intraoperative glucose level is associated with a higher postoperative glucose level. Intraoperative hyperglycemia increases the odds for postoperative hyperglycemia. Adequate intraoperative glucose management by initiating insulin infusion when glucose level exceeds 140 mg/dL to prevent hyperglycemia is associated with lower postoperative glucose levels and fewer incidences of postoperative hyperglycemia. However, patient- and procedure-specific variable interactions make the relationship between intraoperative and postoperative glucose levels complicated.