Sedentary lifestyle has become quite prevalent lately, and it has been associated with cardiovascular diseases (CVDs). CVD is a primary cause of premature death in patients with type 2 diabetes mellitus (T2DM). Some studies have focused on the association between sedentary behavior and blood glucose among T2DM patients. However, the occurrence and development of CVD involves many factors, such as blood glucose, blood lipid and so on. Therefore, we comprehensively examined the association of sedentary time with overall CVD risk and various metabolic risk factors in T2DM patients. A total of 775 middle-aged and elderly patients with T2DM were assessed. Framingham risk equation was employed to assess their overall CVD risk, while the sedentary time was self-reported. Demographic data and anthropometric and cardiac metabolic indicators were separately analyzed for both genders. The median age of the respondents was 55 (range: 45-75) years, and 39.23% were women. The overall risk of CVD in women was lower than that in men. Linear regression analysis revealed that sedentary time was significantly positively correlated with overall CVD risk and triglyceride level, but not with diastolic blood pressure and glycosylated hemoglobin and high-density lipoprotein cholesterol (HDL-C) levels. However, the correlation of sedentary time with fasting blood glucose level, body mass index, total cholesterol, and low-density lipoprotein cholesterol was only detected in women. In middle-aged and elderly patients with T2DM, prolonged sedentary time may increase the triglyceride levels and the overall risk of CVD. The adverse effects of sedentary time on fasting blood glucose, body mass index, total cholesterol, and low-density lipoprotein cholesterol may exhibit sex-based differences, as they were detected only in women.