I need to get the value of the PrimaryKey of the last record entered into a table, without inserting a record. I have tried wriring a stored procedure to do this with 0 success. (you will laugh I am sure!). I am using the result on a web page that is receiving info from the same table. Can I add IDENT_CURRENT into the stored procedure of another querry to get the value?
CREATE Procedure spGetLastReturnIDFromCMRCRGA
@lastreturnID int output
@lastReturnID = IDENT_CURRENT