Here is what I have:
I want to get SesID from an ExecuteScalar call from ADO.Net. Basically, I want to get the new Primary key from this insert. I can do an EXEC and see the value, but I can't seem to get it out in ADO.NET. Any ideas?
Code:
CREATE PROCEDURE dbo.MakeSession
@month int, @job int,
@MDate smalldatetime,
@SesID int OUTPUT
AS
INSERT INTO Sessions (EvntMonth, JobNumber, SessionDate)
VALUES (@month, @job, @MDate)
SELECT @SesID = @@IDENTITY
I want to get SesID from an ExecuteScalar call from ADO.Net. Basically, I want to get the new Primary key from this insert. I can do an EXEC and see the value, but I can't seem to get it out in ADO.NET. Any ideas?