Patients admitted to Parkland Hospital with type 2 diabetes will be recruited to the study within 24 hours of admission. Gravid patients, patients in DKA, or HHS will be excluded. All patients will be evaluated for inclusion and exclusion criteria. During the hospitalization, patients will be stratified by age and admitting diagnosis and randomized to either an "aggressive" blood glucose control (goal pre-prandial CBG <110 mg/dl) or a "conservative" blood glucose control (goal pre-prandial CBG <180 mg/dl). Subcutaneous detemir and novolog will be employed according to the enclosed protocol to meet the goal blood glucose level. The insulin will be administered by nursing staff via the FlexPen, a pre-filled pen-like insulin delivery device. CBGs will be obtained before breakfast, before lunch, before supper, and at bedtime. If a patient is NPO, then the CBGs will be obtained at the time that the patient was to have eaten.