Objective To investigate the efficacy of dapagliflozin for diabetes mellitus complicated by coronary artery diseases and its impact on vascular endothelial function. Methods Between August 2020 and August 2021, 80 patients with coronary heart disease complicated by type 2 diabetes mellitus were recruited and randomly assigned to receive either dapagliflozin (5 mg daily) plus original oral hypoglycemic agents (dapagliflozin group) or original oral hypoglycemic agents alone (control group). Outcome measures included blood pressure, blood glucose, cholesterol levels, vascular endothelial function, cardiovascular events, and drug-related adverse events. Results The two groups had similar outcome indices upon admission (P > 0.05). After 20 weeks of medication, the two groups of patients showed similar blood pressure, hemoglobin A1c (HbA1c), and low-density lipoprotein (LDL-C) levels versus those before treatment (P > 0.05), and no significant differences were found in intergroup comparison neither (P > 0.05). Dapagliflozin plus conventional hypoglycemic agents resulted in a significantly higher reactive hyperemia index (RHI) value, fewer cases with abnormal vascular endothelial function, and fewer major cardiovascular events during treatment versus the sole use of conventional hypoglycemic agents (P 0.05). Conclusion Dapagliflozin improves the vascular endothelial functions of patients with diabetes mellitus complicated by coronary artery disease with a high safety profile and favorable efficacy.