After adjusting for confounding factors, serum S100B levels were positively correlated with cognitive function in type 2 diabetes patients. Here, S100B is linked to type 2 diabetes mellitus.