As the number of cardiac implantable electronic devices (CIEDs) is increasing annually, CIED-related complications are becoming increasingly important. The aim of the study was to assess the risks associated with CIEDs by a nationwide database. Patients were selected from the Taiwan National Health Insurance Database. Admissions for CIED implantation, replacement, and revision were evaluated and the evaluation period was 14 years. Endpoints included CIED-related infection, pneumothorax, and heart perforation. The study included 40,608 patients with a mean age of 71.8 ± 13.3 years. Regarding infection, the incidence rate was 2.45 per 1000 CIED-years. Male gender, younger age, device replacement, and previous infection were risks for infection while old age and high-volume centers (>200 per year) were protectors. The incidence of pneumothorax was 0.6%, with an increased risk in individuals who had chronic obstructive lung disease (COPD) and cardiac resynchronized therapy (CRT). The incidence of heart perforation was 0.09%, with an increased risk in individuals who had pre-operation temporal pacing and steroid use. High-volume center was found to decrease infection rate while male gender, young people, and individuals who underwent replacements were associated with an increased risk of infection. Additionally, pre-operation temporal pacing and steroid use should be avoided if possible. Furthermore, COPD patients or those who accept CRTs should be monitored closely.