Abstract Objective To analyze the effect of sodium-dependent glucose transporter-2 (SGLT-2) inhibitor in the treatment of type 2 diabetes mellitus complicated with heart failure. Methods A total of 80 patients with type 2 diabetes complicated with heart failure admitted to Xinyu People′s Hospital from January 2020 to January 2021 were selected as the research objects, they were divided into control group (40 cases) and observation group (40 cases) according to random number table method. Both groups were treated with conventional anti-heart failure therapy, the control group treated with conventional hypoglycemic treatment, and the observation group treated with SGLT-2 inhibitor hypoglycemic treatment. The incidence of blood glucose, inflammatory factors, oxidative stress and adverse reactions were compared between the two groups. Results There were no significant differences in fasting blood glucose (FPG) and 2 h postprandial blood glucose (2 h PG) levels between two groups before treatment (P>0.05). After treatment, the levels of FPG and 2 h PG in the two groups were lower than before treatment, and the levels of FPG and 2 h PG in the observation group were higher than those in the control group, the differences were statistically significant (P<0.05). Before treatment, there were no significant differences in left ventricular ejection fraction (LVEF), output per wave (SV) and mitral valve inflow ratio (E/A) between two groups (P>0.05). After treatment, LVEF, SV and E/A in the two groups were higher than those before treatment, and LVEF, SV and E/A in the observation group were higher than those in the control group, the differences were statistically significant (P<0.05). There were no significant differences in the levels of C-reactive protein (CRP), tumor necrosis factor-α (TNF-α), malondialdehyde (MDA) and superoxide dismutase (SOD) between two groups before treatment (P>0.05). After treatment, the levels of CRP, TNF-α and MDA in the two groups were lower than those before treatment, while SOD was higher than that before treatment, with statistical significances (P<0.05). After treatment, the levels of CRP, TNF-α and MDA in the observation group were lower than those in the control group, while the level of SOD was higher than that in the control group, with statistical significances (P<0.05). There was no significant difference in 6 min walking distance before treatment between two groups (P>0.05). The 6 min walking distance of the two groups after treatment was longer than that before treatment, and the distance of the observation group was longer than that of the control group, the differences were statistically significant (P<0.05). The rehospitalization rate of heart failure in the observation group was lower than that in the control group, and the difference was statistically significant (P<0.05), while there was no significant difference in cardiovascular mortality between the two groups (P>0.05). The total incidence of adverse reactions in the observation group was lower than that in the control group, and the difference was statistically significant (P<0.05). Conclusion SGLT-2 inhibitor has significant efficacy in patients with type 2 diabetes mellitus complicated with heart failure, such as promoting the improvement of heart function and controlling blood glucose level.