How can I get the id of a record after it is inserted into a SQL table, I'm working with .net and sql server, if I have this stored procedure example
CREATE PROCEDURE dbo.sp_Students_INS_byPK
@student_id INT ,
@password VARCHAR(15) = NULL ,
@active_flg TINYINT ,
@lastname VARCHAR(30) = NULL ,
@birth_dttm DATETIME = NULL ,
@gpa INT = NULL ,
@is_on_staff TINYINT
AS
BEGIN
SET NOCOUNT ON
INSERT INTO dbo.Students
(
student_id ,
password ,
active_flg ,
lastname ,
birth_dttm ,
gpa ,
is_on_staff
)
VALUES
(
@student_id ,
@password ,
@active_flg ,
@lastname ,
@birth_dttm ,
@gpa ,
@is_on_staff
)
END
GO