Comment by strken
https://www.sciencedirect.com/science/article/pii/S216183132...
There's a complicated relationship, according to this meta-analysis. Eating sugar in isolation from other sources of nutrition is a risk factor. Eating fruit, or eating sweetened foods with redeeming qualities like yoghurt and wholegrain cereal, is probably inversely correlated (with lower confidence). These seem to be true even when controlling for BMI.
Looking at the meta-analysis, it's hard to say there's no link. The authors suggest that fibre might mitigate the impact, and that adding sugar to otherwise healthy foods might encourage higher consumption of them.