Get newly created record's ID??

Discussion in 'ASP .Net' started by David Lozzi, Dec 7, 2004.

  1. David Lozzi

    David Lozzi Guest

    I'm creating new records in my aspx file, but after its created, I need the ID of the new record. The ID field is the primary key and increments automatically. Should this be completed in a proc? Sorry about the cross group post, but I'm not sure where and who would know this.

    Thanks!

    --
    David Lozzi
    Web Applications/Network Specialist
    Delphi Technology Solutions, Inc.
    dlozzi(remove-this)@delphi-ts.com
     
    David Lozzi, Dec 7, 2004
    #1
    1. Advertising

  2. You can get the last generated Identity value in your stored procedure with SCOPE_IDENTITY() on SQL Server 2000, and @@IDENTITY on SQL Server 7.

    --
    Jacco Schalkwijk
    SQL Server MVP


    "David Lozzi" <dlozzi(remove-this)@delphi-ts.com> wrote in message news:...
    I'm creating new records in my aspx file, but after its created, I need the ID of the new record. The ID field is the primary key and increments automatically. Should this be completed in a proc? Sorry about the cross group post, but I'm not sure where and who would know this.

    Thanks!

    --
    David Lozzi
    Web Applications/Network Specialist
    Delphi Technology Solutions, Inc.
    dlozzi(remove-this)@delphi-ts.com
     
    Jacco Schalkwijk, Dec 7, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Craig
    Replies:
    1
    Views:
    1,930
    =?Utf-8?B?SmFtZXM=?=
    Jan 25, 2006
  2. jason2k
    Replies:
    0
    Views:
    399
    jason2k
    Jul 27, 2006
  3. =?Utf-8?B?UHJhdmlu?=

    how to fetch only newly added/edited record

    =?Utf-8?B?UHJhdmlu?=, Mar 29, 2007, in forum: ASP .Net
    Replies:
    9
    Views:
    421
    =?Utf-8?B?UGFsbGF2aQ==?=
    Apr 13, 2007
  4. fig000
    Replies:
    0
    Views:
    638
    fig000
    Sep 6, 2008
  5. Craig
    Replies:
    0
    Views:
    149
    Craig
    Jan 2, 2006
Loading...

Share This Page