I have a table definition like this:
ID int /* identity column */
SecondID nvarchar(50) /* ComputedColumn */
birthdate datet */ Simple Column */
I would like to insert values on this table and I would like to get the inserted value as output,
the first ID, I got it using the scope_identity
function.
Computed Function : ID * 1000
as an example, I would like to insert these values : (1,1000,12/08/2021)
What can I get from now is only the ID,
CREATE PROCEDURE [dbo].[USER_insert]
@birthdate date,
@SecondIDOut nvarchar(50) output
Begin
AS
INSERT INTO [dbo].[User]
([birthdate])
VALUES
(@birthdate)
SET @ID = scope_identity()
/* SET @SecondIDOut = ?? what can I set here */
END
How can I get the SecondID after executing the SQL insert statement?