Login | Register   
LinkedIn
Google+
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


Tip of the Day
Language: Enterprise
Expertise: Intermediate
Nov 15, 2002

Determine the Identity Value of Inserted Row(s)


IN tblTicker table we have following fields:
 
	[CompanyID] INT IDENTITY (1,1)
	[TickerSymbol] [char] (10) NULL
	[ClassOfShare] [char] (10) NULL

We inserted some rows and deleted some from table tblTicker.Now At the time of fresh insertion if we will use the following code we will get the identity value of inserted row.
 
INSERT INTO tblTicker(TickerSymbol,ClassOfShare)
VALUES('SRCE','A')
SELECT @@IDENTITY

If the table tblTicker was having 5 rows and then we deleted any two rows. Now if we insert one row the Identity value will be 6.
Ajit Kumar
 
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap
Thanks for your registration, follow us on our social networks to keep up-to-date