What is the use of SCOPE_IDENTITY() function?

Answers were Sorted based on User's Feedback

What is the use of SCOPE_IDENTITY() function?..

Answer / saravakumar

Returns the most recently created identity value for the
tables in the current execution scope.

Is This Answer Correct ?    4 Yes 1 No

What is the use of SCOPE_IDENTITY() function?..

Answer / bhupesh

Returns the last identity value inserted into an identity
column in the same scope. A scope is a module: a stored
procedure, trigger, function, or batch.

Is This Answer Correct ?    3 Yes 1 No

Post New Answer

More SQL Server Interview Questions

What are the two types of concurrency?

4 Answers  

hi... this is charan.I persued btech in 2010 looking for a job on database/back-end as freehser. can any seggest me which course or back-end tool i have to learn

0 Answers  

Differences between logshipping and mirroring

1 Answers   Syntel, Microsoft,

hw you create table in sql using existing table and variable should be in specific order given ex : in old table empid empname empsal empage empbirthdate empaddrs like is there in new table we need it as EX: exmpname empage empaddrs empid empbirthdate like we want hw we create this as a table not view or nt reporting

2 Answers  

What are the all different types of Joins in SQL Server 2000, Anybody can explain each join with definition..Thanks in advance....

9 Answers   Infosys, TCS, DELL, Siemens, i Tech,

What is BCP? When do we use it?

2 Answers  

What is Outter Join?

1 Answers  

what is performance tunning in sql server ? explain.

1 Answers   Thomson Reuters,

If there exist a index on the table, and we then make a view on that table (include the indexed column from base table) than why do we require indexing on view?Doesnt it create an overhead?

2 Answers  

how to write the query to select the rows are in the order of either 1,3,5,7... or 2,4,6,8,...

7 Answers   Satyam, ADP, Tech Mahindra,

How to write query to Delete the records in child table and corresponding records in parent table

11 Answers   Semantic Space,

What is normalization and what are the different forms of normalizations?

2 Answers