ALLInterview.com :: Home Page KalAajKal.com
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
tip   SiteMap shows list of All Categories in this site.
Google
 
Categories  >>  Software  >>  Databases  >>  SQL Server
 
 


 

 
 Oracle interview questions  Oracle Interview Questions
 SQL Server interview questions  SQL Server Interview Questions
 MS Access interview questions  MS Access Interview Questions
 MySQL interview questions  MySQL Interview Questions
 Postgre interview questions  Postgre Interview Questions
 Sybase interview questions  Sybase Interview Questions
 DB Architecture interview questions  DB Architecture Interview Questions
 DB Administration interview questions  DB Administration Interview Questions
 DB Development interview questions  DB Development Interview Questions
 SQL PLSQL interview questions  SQL PLSQL Interview Questions
 Databases AllOther interview questions  Databases AllOther Interview Questions
Question
How to Get the last identity value used
 Question Submitted By :: Guest
I also faced this Question!!     Rank Answer Posted By  
 
  Re: How to Get the last identity value used
Answer
# 1
the last identity value used in an insert can be retrieved 
with the @@identity function.
 
Is This Answer Correct ?    1 Yes 0 No
Guest
 
  Re: How to Get the last identity value used
Answer
# 2
select @@identity

@@identity is global variable
 
Is This Answer Correct ?    2 Yes 0 No
Laxman
 
 
 
  Re: How to Get the last identity value used
Answer
# 3
dbcc checkident(table)
 
Is This Answer Correct ?    0 Yes 0 No
J.m.
 
  Re: How to Get the last identity value used
Answer
# 4
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 ?    0 Yes 0 No
Chandramohan
 

 
 
 
Other SQL Server Interview Questions
 
  Question Asked @ Answers
 
What are the advantages of using sql server over ms access or why should one use sql instead of ms access Impetus1
what is Archive old data?  1
what are three different authentications to connect linked servers? CitiGroup1
What is a view?  4
What are the advantages of using views. Why do we need views when we have SPs? 247Customer3
Hello all, I have data like :- year amt 2004 10 2005 20 2006 30 Now i want output as:- 2004 2005 2006 10 30 60 but i have to use here group by on year.So, i need a single query within that i can find.  2
What is the diff between Dynamic queries and static queries ICS-Integrated-Computer-Solutions1
After using delete statement in sql query to delete some records...to retrieve the deleted records we can get using rollback command but till that where it stores means particular location name i need....(after deleting and rollback ) iGate2
what is the output for this query select * from employee where 1=1;  4
what are default? Is there a column to which a default cant be bound?  1
Can we call SP inside a query? Wipro4
what is the out put of below queries? a. select * from Emp where null = null; b. select * from Emp where 1=1; Patni9
Difference between Function and Stored Procedure? C1-India4
Difference between Triggers and Stored Procedure Protech9
Which system table contains information on constraints on all the tables created?  2
What is the difference between constraints and triggers? Wipro6
what is diffence between replicaion and logshipping?  1
Hi SQL gurus, i am working for an MNC... My team is having a problem in sql server. when user slects date prompts from jan 1st to april 30, it should display all months data like : jan aa feb bb mar cc but when it comes to april its taking data like : jan aa feb bb mar cc apr dd...and so on means its taking data again from jan to april which we dont want. we want the data only april month as we are getting jan, feb and mar... can any one write the code to relsove the issue please would be greatful if you can send to shiva_sans@yahoo.co.in and also please send your email also ...so that we will be in touch for any kind of queries ... Thanks a lot in Advance !!!  1
MULTICAST DELEGATES IN C#.NET WITH REAL TIME EXAMPLE IBM1
create index a on employee(dno) In this,which index was created?  2
 
For more SQL Server Interview Questions Click Here 
 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us interview questions urls   External Links 
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  Forum9.com   ::  KalAajKal.com