How to Get the last identity value used

Answers were Sorted based on User's Feedback



How to Get the last identity value used..

Answer / laxman

select @@identity

@@identity is global variable

Is This Answer Correct ?    4 Yes 0 No

How to Get the last identity value used..

Answer / guest

the last identity value used in an insert can be retrieved
with the @@identity function.

Is This Answer Correct ?    3 Yes 0 No

How to Get the last identity value used..

Answer / j.m.

dbcc checkident(table)

Is This Answer Correct ?    1 Yes 0 No

How to Get the last identity value used..

Answer / 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

More SQL Server Interview Questions

Explain about builtinadministrator?

0 Answers  


How can i change the column name.

13 Answers   HCL, Yardi Software,


What is the difference between sdf and mdf?

0 Answers  


What is 3nf normalization?

0 Answers  


What are primary keys and foreign keys?

4 Answers  






How to create a view using data from another view?

0 Answers  


What is an sql server agent?

0 Answers  


Explain what is dbcc?

0 Answers  


Explain Different types of Projects?

1 Answers  


diffrence between Cluster Index and non Cluster Index

3 Answers   Wipro,


How do I start sql server agent automatically?

0 Answers  


Explain nested stored procedure. Syntax and an example for create nested stored procedure?

0 Answers  


Categories