Is there a better way of getting the primary key ID of a record that I had just newly inserted via stored procedure? I currently use:
Code:
CREATE PROCEDURE strInsertRecord
@value1 varchar(50),
@value2 varchar(50),
@NewRecordID int OUTPUT
AS
INSERT INTO MyTable (Field1, Field2) VALUES (@value1, @value2)
SET @NewRecordID = [b](SELECT MAX(PrimaryKeyID) FROM MyTable)[/b]
RETURN