A special court here has sentenced a doctor to two years in jail for violating the Pre-Conception and Pre-Natal Diagnostic Technique (PCPNDT) Act by advising a pregnant woman to undergo sex-determination test.