TABLE -> Example (A,B,C,D)
A is an identity column. How can I do:
INSERT INTO Example(B,C,D) VALUES (b,c, 'valueOF(A) sometext');
I.e. I want to access the value of identity column 'A' in column D during insertion.
Is it possible?
TABLE -> Example (A,B,C,D)
A is an identity column. How can I do:
INSERT INTO Example(B,C,D) VALUES (b,c, 'valueOF(A) sometext');
I.e. I want to access the value of identity column 'A' in column D during insertion.
Is it possible?
Copyright © 2021 Jogjafile Inc.
Yes with output keyword:
Now you have in
@Resulttable inserted value of columnA.If you have
Sql Server 2012+then you can usesequential object. Removeidentityfrom columnA. Then create a sequence:Then use it like: