Catalyzes the formation of NAD(+) from nicotinamide mononucleotide (NMN) and ATP. Can also use the deamidated form; nicotinic acid mononucleotide (NaMN) as substrate with the same efficiency. Can use triazofurin monophosphate (TrMP) as substrate. Also catalyzes the reverse reaction, i.e. the pyrophosphorolytic cleavage of NAD(+). For the pyrophosphorolytic activity, prefers NAD(+) and NaAD as substrates and degrades NADH, nicotinic acid adenine dinucleotide phosphate (NHD) and nicotinamide guanine dinucleotide (NGD) less effectively. Involved in the synthesis of ATP in the nucleus, together with PARP1, PARG and NUDT5. Nuclear ATP generation is required for extensive chromatin remodeling events that are energy-consuming. Fails to cleave phosphorylated dinucleotides NADP(+), NADPH and NaADP(+). Protects against axonal degeneration following mechanical or toxic insults.