How to Get the last identity value used

Answer Posted / chandramohan

scope_identity() would be the currect answer. To avoid potential problems professionals suggests this method since it returns the recently added value.

Is This Answer Correct ?    1 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to attach adventureworkslt physical files to the server?

627


How many primary keys are possible in a table?

515


List the data types available in mssql?

520


What is the difference between sdf and mdf?

672


What are partitioned views and distributed partitioned views?

600






How can you fetch alternate records from a table?

539


what authentication modes does sql server support? : Sql server database administration

516


What is precedence constraint?

541


What is a benefit of using an after insert trigger over using a before insert trigger?

505


What are different types of data sources?

488


Explain about Joins?

603


What is data mart? : sql server analysis services, ssas

584


If we delete pack Spec what will be the status of pack Body ?

966


What is the difference between Triggers and Stored Procedure?

565


How to enter binary string literals in ms sql server?

578