Mar 13, 2001 #1 EscapeUK Programmer Jul 7, 2000 438 GB I need a store procedure that first of all inserts a record then returns the ID number which is automatically generated for the inserted record. Can this be done in the same stored procedure, if yes can you help with the code.
I need a store procedure that first of all inserts a record then returns the ID number which is automatically generated for the inserted record. Can this be done in the same stored procedure, if yes can you help with the code.
Mar 13, 2001 #2 cdukes Programmer Aug 6, 1999 286 FR INSERT X,y,Z INTO tblABC VALUES (1,2,3) Return (@@Identity) This assumes that the table has an identity field defined as the primary key. hope this helps, Chris Dukes Upvote 0 Downvote
INSERT X,y,Z INTO tblABC VALUES (1,2,3) Return (@@Identity) This assumes that the table has an identity field defined as the primary key. hope this helps, Chris Dukes