sql server - How to know the value of the INT sequential I just INSERTed in SQL 2008 R2 -


i have these tables (simplified clarity):

table changes changeid  bigint memberid  varchar(10) changedon smalldatetime  table fieldchanges changeid  bigint fieldname varchar(30) oldvalue  varchar(100) newvalue  varchar(100) 

in order keep track of changes made member (memberid).

what want insert record in changes, sql generating sequential value (by using isidentity) changeid column , insert record in fieldchanges value , other details. now, insert , select latest record memberid, wondering if there efficient way this, sql returning value of changeid column when doing insert.

to identity value of inserted identity column, use select scope_identity()

the scope specific stored proc, script batch, function or trigger.


Comments

Popular posts from this blog

java - Run a .jar on Heroku -

java - Jtable duplicate Rows -

validation - How to pass paramaters like unix into windows batch file -