如何避免在 ms sql 中多次插入同一行?
SqlCommand cmd1 = new SqlCommand("insert student_vs_testsession_details(student_id,testsession_id,testsession_status,test_type) values('" + id + "','" + Test + "','','" + s_testtype + "') where NOT EXISTS(select student_id from student_vs_testsession_details where testsession_id='" + lb_testid.Text + "' and student_id='"+id+"')", con);