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 is the difference between views and stored procedures? Can we have input parameters for views?

6 Answers  


What is molap and its advantage? : sql server analysis services, ssas

0 Answers  


Following are some of the question related to below mentioned query? select e1.salary from employee3 e1 where 2= ( select count(distinct(e2.salary)) from employee3 e2 where e2.salary>=e1.salary ) 1) What the query returns? 2) How it works? - Detail explanation (what the sub query does, why it is (where 2=)....etc...Please?

5 Answers  


Explain “not null constraint” in sql server?

0 Answers  


wat is the main diff between sql server 2000and sql server 2005

6 Answers   Jade Software,






can you any body tell me the difference between candidate key and primary key

4 Answers  


What is the difference between windows authentication and sql server authentication

7 Answers   HCL,


Can a table have 2 foreign keys?

0 Answers  


What are the different types of queries?

1 Answers  


What authentication modes does sql server support?

0 Answers  


Why do we use stored procedures in sql server?

0 Answers  


Write SQL queries on Self Join and Inner Join.

0 Answers   Aspiring Minds,


Categories