Wrox Programmer Forums
Go Back   Wrox Programmer Forums > SQL Server > SQL Server ASP
| Search | Today's Posts | Mark Forums Read
SQL Server ASP Discussions about ASP programming with Microsoft's SQL Server. For more ASP forums, see the ASP forum category.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Server ASP section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old January 4th, 2007, 09:53 PM
Friend of Wrox
Points: 422, Level: 7
Points: 422, Level: 7 Points: 422, Level: 7 Points: 422, Level: 7
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
Join Date: Jul 2003
Location: La Jolla, CA, USA.
Posts: 112
Thanks: 0
Thanked 0 Times in 0 Posts
Default Determine next autonumber field value

Is there a way to determine the next autonumber field without actually adding a record and executing .Update using ADO?

I am using a table to store successful form data copied from a temporary table and need the autonumber ID field value (for various reasons) before actually creating a record in the table.
  #2 (permalink)  
Old January 22nd, 2007, 12:17 AM
Registered User
Join Date: Dec 2006
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts


  #3 (permalink)  
Old February 22nd, 2007, 04:01 AM
Registered User
Join Date: Feb 2007
Location: Kolkata, West Bengal, India.
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to samarroy Send a message via Yahoo to samarroy

How can you get the next value of an autoincrement field of a particular table......

Hope it will help you....

SELECT IDENT_CURRENT('TableName') + ( SELECT IDENT_INCR('TableName') ) AS NextAutoIncrementFieldValue




Similar Threads
Thread Thread Starter Forum Replies Last Post
Retrieve Autonumber field and update it carrie09 Access VBA 3 November 2nd, 2007 07:32 AM
AutoNumber field tulincim Access 5 June 6th, 2006 03:44 PM
Hiding Autonumber Field Brendan Bartley Access 4 November 14th, 2005 11:34 AM
Autonumber display in form field ianc Access 2 January 14th, 2005 07:11 AM
Deriving an Autonumber field paulkholt Pro VB Databases 0 August 20th, 2004 10:51 AM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.