.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Interview Question >> Sql Server >> Post New Question Subscribe to Interview Questions

what is @@identity in sqlserver?

Posted By :Mallikarjuna Chigicherla     Posted Date :August 08, 2010    Points :10   Category :Sql Server 
@@Identity returns the last identity value inserted in any table or session of the database

You can also find related Interview Question to what is @@identity in sqlserver?  below: 

More than one IDENTITY column per table can be exist in SQL Server . (True /False)

  
False.
There can only be one IDENTITY column per table in SQL Server.
Its auto Incremented Column defined by the user. (More...)

What is the use of Dense_Rank in Sqlserver?

  
Dense_Rank function produces the gaps in the ranking system (More...)

How to rename a database in SQLserver?

  
using the procedure sp_renamedb. Following is the syntax

Exec sp_renamedb 'olddbname','newdbname' (More...)

Difference between oracle, sql and sqlserver?

  
Oracle is based on RDBMS.SQL is structured query language,pronounced "sequel", is a language that provides an interface to relational database systems.and sql server is tool for RDBMS provided b Microsoft. (More...)

what is @@IDENTITY

  
Is a system function that returns the last-inserted identity value (More...)

what is the use of ISNULL in sqlserver-2005?

  
It is the expression to be checked for NULL. check_expression can be of any type

For More details please follow this link:

http://msdn.microsoft.com/en-us/library/ms184325.aspx (More...)

Can we insert a value for the identity Column in Sql Server?

  
Yes, We can insert the value for Identity column

using SET IDENTITY INSERT ON

e-g


CREATE TABLE #Temp(ID INT IDENTITY, EmpName VARCHAR(255))

SET IDENTITY_INSERT #Temp ON
INSERT INTO #Temp(ID, EmpName)
Values(10, 'Alwyn Duraisingh.M')
SET IDENTITY_INSERT #Temp OFF
(More...)

Write a SQL query to send mail, whenever a new record is inserted into a table using Sqlserver 2000.

  
Here we have to create a trigger on required table as show below.


CREATE TRIGGER SendRem
ON TableX
AFTER INSERT
AS

EXEC master..xp_sendmail
@recipients='you@you.com',
@message = 'body'
@subject = 'foo was fired.'
GO
(More...)

Quick Links For Interview Questions Categories:
ASP.Net Windows Application   .NET Framework   C#   VB.Net   ADO.Net  
Sql Server   SharePoint   Silverlight   OOPs   JQuery   JavaScript/VBScript
Biztalk Patten/Practices .IIS WCF WPF WWF
Networking Aptitude Others   All      

Find questions, FAQ's and their answers related to .NET, C#, Vb.Net, Sql Server and many more.

 
Now you can find lots of .NET, C#, Vb.Net, SQL Server,Windows, ASP.Net related Questions and their Answers here at www.dotnetspark.com. Our aim is to help you pass your certification Exams (MCP, MCSD, MCAD etc.,) with flying scores and get good name in your company.

So, Start looking our Interview Question section daily and improve your .NET Skills. You can also help others by posting Interview Questions and their Answers in this section.


Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend