Results 1 to 5 of 5

Thread: [RESOLVED] Get the PK of a auto increment value you just inserted

Threaded View

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    May 2005
    Posts
    431

    Resolved [RESOLVED] Get the PK of a auto increment value you just inserted

    right now my program inserts a new record and a PK of int is automatically created. But I also need a second query to insert data into another table that has a 1:1 relationship.

    Is it possible to somehow get the auto increment value that was created from my insert statement? Or should I simple do another select query to get the latest entry inserted?

    I guess for now ill use
    Code:
    SELECT max(ID) FROM tableName
    Last edited by Zeratulsdomain; Mar 19th, 2008 at 02:47 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width