Pregnant women with type 2 diabetes mellitus (T2DM) are at increased risk for miscarriages, birth defects, large infants, and stillbirths. Maintaining blood sugars in the normal range decreases these pregnancy complications. We hypothesize that metformin will achieve similar levels of blood sugar control compared to insulin. In doing so, metformin will prevent the increased risk of pregnancy complications associated with T2DM in pregnancy. We propose a pilot study of a randomized, controlled trial of metformin versus insulin in the treatment of T2DM during pregnancy.