Initiation of an SGLT2 inhibitor versus a DPP4 inhibitor was associated with lower dementia risk among people with BMI < 30 kg/m2 (HR [95% CI]: 0.82 [0.70–0.94]) but not among those with BMI ≥ 30 kg/m2 (HR [95% CI]: 0.97 [0.86–1.09]; heterogeneity: p = 0.072). The gene discussed is SLC5A2; the disease is dementia.