Background: We aimed to investigate the long-term effects of metabolic profiles and microbiota status in patients after upper gastrointestinal (GI) surgery and lower GI surgery and compared them with a control group. Methods: In this cross-sectional study, we analyzed the occurrence of metabolic syndrome (MS) in 10 patients who underwent curative total gastrectomy with Roux-en-Y esophagojejunostomy (RYEJ) anastomosis, 11 patients who underwent curative partial colectomy with right hemicolectomy (RH), and 33 age- and sex-matched controls. Fecal samples were also analyzed by a next-generation sequencing method. Results: Compared with the control group, the occurrence of MS was significantly lower among patients who underwent total gastrectomy with RYEJ than the controls over the long-term follow-up (>8 years; p < 0.05). Patients who received RH only had a trend of higher serum fasting glucose (p = 0.10). The diversity of the gut microbiota significantly decreased after RH in comparison with the control group and RYEJ group, respectively (p < 0.05). Principal component analysis revealed significant differences between the control, RYEJ, and RH groups (p < 0.001). At the genus level, the ratio of Prevotella to Bacteroides (P/B) was significantly higher in the RYEJ group than in the control group, whereas the P/B ratio was significantly lower in the RH group than in the control group (p < 0.05). Conclusion: Early gastric cancer patients who received total gastrectomy with RYEJ had a lower occurrence of MS than the controls, while early colorectal cancer patients who received RH were associated with a higher serum fasting glucose than the controls during long-term follow-up. In parallel with the metabolic differences, the P/B ratio was also significantly altered in patients after upper and lower GI surgery.