Diodes with an erbium and nitrogen codoped magnesium zinc oxide (MgZnO:Er,N) active layer were fabricated by spray pyrolysis on Si substrate with aqueous solutions including magnesium nitrate, zinc acetate, erbium acetate, ammonium acetate, and indium nitrate precursors. Diodes with different nitrogen content in their precursor were prepared and their properties were investigated. With scanning electron microscopy, film surface with mixed hexagonal flakes and tiny blocks was characterized for all samples. Certain morphologies varied for samples with different N contents. In the photoluminescence analyses, the intensity of the oxygen-related defects peak increased with the increasing of nitrogen content. The diodes were fabricated with an Au and In deposition on the top and backside. The diode current-voltage as well as capacitance-voltage characteristics were examined. An ununiformed n-type concentration distribution with high concentration near the interface in the MgZnO:Er,N layer was characterized for all samples. Diodes with high nitrogen content exhibit reduced breakdown voltage and higher interface concentration characteristics. Under reversed bias conditions with an injection current of 50 mA, a light spectrum with two distinct green emissions around wavelengths 532 and 553 nm was observed. A small spectrum variation was characterized for diodes prepared from different nitrogen content. The diode luminescence characteristics were examined and the diode prepared from N/Zn=1 in the precursor showed an optimal injection current-to-luminescence property. The current and luminescence properties of the diode were characterized and discussed.