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 main control-of-flow T-SQL constructs?

1 Answers  

If we use where clause in the left outer join then how the query would behave/act?

1 Answers  

ehat is the default port no of sql 2000?

2 Answers   IBM,

What types of integrity are enforced by a foreign-key constraint

1 Answers  

What is the maximun sixes of .mdf in sql server 2005

1 Answers  

How can you see what type of locks used?

1 Answers  

How to convert a table data in XML format in sql server?

0 Answers  

What is Check point? Explain in Brief what it will do?

1 Answers   Wipro,

can we give the identity for existing column of the table? (already table contains 10(1-10) unique randam records)

2 Answers  

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

11 Answers   Semantic Space,

How to get last system shutdown time in Sql server when restarted system?

1 Answers  

hi. suppose one person goal is strong knowledge on SQL.... suggest me ...if he learns SQL SERVER or ORACLE? which is best?

7 Answers   TCS, Unisys, Google,