M
Mike Mertes
Hi all,
What's the easiest way to retrieve a single value (post insert identity
fetch) from an output clause in a stored procedure?
For instance:
@CREATE PROCEDURE sp_Insert
@Var1 int
@Var2 int
AS
INSERT INTO tbl1 (Fld1, Fld2)
OUTPUT INSERTED.RecordID
VALUES (@Var1, @Var2);
I am currently using SqlCommand.ExecuteNonQuery to return rows affected
so I prefer not to return a temp table to a dataset or reader. Can I
insert the value into an OUTPUT param?
TIA
-Mike
What's the easiest way to retrieve a single value (post insert identity
fetch) from an output clause in a stored procedure?
For instance:
@CREATE PROCEDURE sp_Insert
@Var1 int
@Var2 int
AS
INSERT INTO tbl1 (Fld1, Fld2)
OUTPUT INSERTED.RecordID
VALUES (@Var1, @Var2);
I am currently using SqlCommand.ExecuteNonQuery to return rows affected
so I prefer not to return a temp table to a dataset or reader. Can I
insert the value into an OUTPUT param?
TIA
-Mike