Digestive endoscopy is an important means of diagnosing and treating gastrointestinal diseases and a tool for screening and monitoring early gastrointestinal tumors. Digestive endoscopy can be performed using midazolam combined with dezocine for sedation and analgesia. This study explored the efficacy and safety of midazolam combined with dezocine. A total of 135 patients undergoing digestive endoscopy in the Department of Gastrointestinal Endoscopy of the Sixth Affiliated Hospital, Sun Yat-sen University, from June 2021 to September 2021, were enrolled and non-blindly and non-randomly divided into a sedation-endoscopy-group (SEG, = 45), anesthesia-endoscopy-group (AEG, = 44), and ordinary-endoscopy-group (OEG, = 46). Vital signs, levels of sedation and analgesia, the degree of pain during colonoscopy, satisfaction, and the incidence of complications were compared among the three groups. There were no statistically significant differences in vital signs (blood pressure, pulse, respiration, and blood oxygen saturation) among the three groups before endoscopy ( 0.05). The AEG reported no pain during colonoscopy, and the pain score during colonoscopy for the SEG was lower than that for the OEG (1.11 ± 1.21 . 3.00 ± 1.16, 0.001). The scores for satisfaction were 8.84 ± 1.30 points in the SEG, 8.95 ± 1.10 points in the AEG, and 6.37 ± 0.90 points in the OEG; the differences were statistically significant ( 0.001). The total incidence of complications in the AEG was 38.64% (17/44), which was significantly higher than that in the SEG [13.33% (6/45)] and OEG [13.04% (6/46)] ( 0.001). In the SEG, the overall incidence of complications in women was significantly higher than that in men ( 0.027). Digestive endoscopy using midazolam combined with dezocine for sedation makes patients more comfortable, more satisfied and more compliant than the ordinary endoscopy. Additionally, it is comparable to endoscopy under general anesthesia with propofol with regard to comfort, satisfaction, and patient compliance and comparable to the ordinary endoscopy with regard to safety. Considering the shortage of anesthesiologists, the application of midazolam combined with dezocine in digestive endoscopy is worthy of clinical popularization. This study has been registered in the Hospital Ethics Committee of the Sun Yat-sen University Sixth Affiliated Hospital (Ethical Number: 2021ZSLYEC-182).