To identify predictors of hypoglycemic and hyperglycemic episodes in hospitalized patients with diabetes with special attention to the effectiveness of sliding scale insulin regimens. Prospective cohort study. Urban university hospital. One hundred seventy-one adults with diabetes mellitus as a comorbid condition admitted consecutively to medical inpatient services during a 7-week period. Demographic, clinical, and laboratory data from inpatient medical records. Rates of hypoglycemic (capillary blood glucose, < or = 3.3 mmol/L [< or = 60 mg/dL]) and hyperglycemic (capillary blood glucose, > or = 16.5 mmol/L [> or = 300 mg/ dL]) episodes. Of the patients, 23% experienced hypoglycemic episodes, and 40% experienced hyperglycemic episodes. The overall rates of hypoglycemic and hyperglycemic episodes were 3.4 and 9.8 per 100 capillary blood glucose measurements, respectively. Independent predictors of hypoglycemic episodes included African American race (relative risk [RR], 2.13) and low serum albumin level (RR, 1.92 per 100-g/L decrease); corticosteroid use was associated with a reduced risk of hypoglycemic episodes (RR, 0.32; P < .05). Independent predictors of hyperglycemic episodes included female gender (RR, 1.67), severity of illness (RR, 1.22 per 10 Acute Physiology and Chronic Health Evaluation III units), severe diabetic complications (RR, 2.32), high admission glucose level (RR, 1.33 per 5.5 mmol/L), admission for infectious disease (RR, 2.14), and corticosteroid use (RR, 3.74; P < .05). Of 171 patients, 130 (76%) were placed on a sliding scale insulin regimen. When used alone, sliding scale insulin regimens were associated with a 3-fold higher risk of hyperglycemic episodes compared with individuals following no pharmacologic regimen (RRs, 2.85 and 3.25, respectively; P < .05). Suboptimal glycemic control is common in medical inpatients with diabetes mellitus. The risk of suboptimal control is associated with selected demographic and clinical characteristics, which can be ascertained at hospital admission. Although sliding scale insulin regimens are prescribed for the majority of inpatients with diabetes, they appear to provide no benefit; in fact, when used without a standing dose of intermediate-acting insulin, they are associated with an increased rate of hyperglycemic episodes.