Friday, March 9, 2012

how can i insert id field automatic in table by stored procedure

i have a student table and i created a stored procedure to insert a new student in this table but student_id field wich i put it as primary key
got error because allready record has same value .
how i can know the last row's student_id value and input a new valid value in one stored procedure

thanksIf you make the Student_ID field an IDENTITY field, it will automatically increment for you.

No comments:

Post a Comment