Select a PK column upon insert using store procedure input output parameter


  • Hello,

    I am developing a web application for which the data is being captured from a form. In order to insert the data   I am writing a stored procedure with input and output parameters.

    I have a Transaction table with the following columns:

    PoojaDetailsID, ReceiptNo - computed varchar(25) contains a combination

    of both characters and numbers, ReceiptDate, FirstName, LastName, TelNo and many other columns...

    I would like to capture the Primary Key/any other column value immediately after the insert. This code should be part of the Stored Procedure. 

    I don't want to use:

    select top (1) * method

    Please suggest. 

    Sunday, November 17, 2013 5:47 PM