We aim to assess efficacy and safety of remifentanil or sulfentanyl combined with propofol during painless gastroscopic examination in patients. In this study, 270 patients were randomly divided into 3 groups: propofol was given only in group P; propofol and remifentanil in group PR; propofol and sulfentanyl in group PS during the gastroscopic examination. Efficiency of group P was significantly lower than that of group PR and PS (P<0.01). Efficiency of group PR was lower than that of group PS (P<0.05). Incidence of chest wall rigidity and oxygen desaturation in group PR were higher than group P and PS (P<0.05), whereas there was no difference between groups P and PS (P>0.05). Propofol combined with remifentanil could provide satisfying anesthesia and more respiratory depression, whereas sulfentanyl at equivalent dose combined with propofol could also provide with satisfying anesthesia and less respiratory depression. Combined sufentanyl with propofol would be an effective anesthesia technique in the daytime procedure.