By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,552 Members | 893 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,552 IT Pros & Developers. It's quick & easy.

get autonumber column value

P: n/a
Hi,

I am inserting records into a table having a autonumber column(ID) as
primary key. I get the value of ID by using select Max(ID) from table. Is
there any way to retieve the value immediately after inserting the record
without another query (like in ado). Any tutorials with example would be
great

Thanks

Srinivas
Nov 20 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Srinivas,
This depends on the type of database used. See
ms-help://MS.VSCC.2003/MS.MSDNQTR.2003FEB.1033/cpguide/html/cpconretrievingi
dentityorautonumbervalues.htm
in the VS.NET help files on "Retreiving Identity or Autonumber Values" (or
search for this in MSDN online).

Ron Allen
"Reddy" <an********@NO.JUNK.MAIL> wrote in message
news:O2**************@TK2MSFTNGP09.phx.gbl...
Hi,

I am inserting records into a table having a autonumber column(ID) as
primary key. I get the value of ID by using select Max(ID) from table. Is
there any way to retieve the value immediately after inserting the record
without another query (like in ado). Any tutorials with example would be
great

Thanks

Srinivas

Nov 20 '05 #2

P: n/a
On Tue, 13 Jan 2004 11:53:46 -0000, "Reddy" <an********@NO.JUNK.MAIL> wrote:

Hi,

I am inserting records into a table having a autonumber column(ID) as
primary key. I get the value of ID by using select Max(ID) from table. Is
there any way to retieve the value immediately after inserting the record
without another query (like in ado). Any tutorials with example would be
great

No, it requires a bit of effort.

http://longhorn.msdn.microsoft.com/l...bervalues.aspx
Paul ~~~ pc******@ameritech.net
Microsoft MVP (Visual Basic)
Nov 20 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.