High blood glucose levels in hospitalized patients with diabetes are associated with increased risk of medical complications. Improved glucose control with insulin injections may improve clinical outcome and prevent some of the hospital complications. It is not known; however, what is the best insulin regimen in hospitalized patients. Recently, the use of basal/bolus insulin therapy with detemir (Levemir®) and rapid-acting insulin (lispro, aspart, glulisine) has been shown to facilitate outpatient glycemic control with lower rate of hypoglycemic (low blood sugar) events in patients with diabetes. In this study, we will determine the efficacy and safety of the combination of detemir and aspart insulin in the inpatient management of subjects with diabetes. We hypothesize that in patients with type 2 diabetes admitted to general medicine wards, treatment with insulin detemir once daily plus insulin aspart before meals will allow better glycemic control and lower rate of hypoglycemic events than treatment with twice a day NPH plus regular insulin before meals. Detemir is a long-acting insulin which is given subcutaneously (under the skin) once daily. Aspart is a rapid-acting insulin which is given subcutaneously several times a day and frequently before meals. Detemir and aspart insulins are approved for use in the treatment of patients with diabetes by the FDA.