Online Loans - Loans - Credit Card - Loans - Advertising

PDA

View Full Version : Get the ID of record just inserted


tomred
Aug 7th 2007, 5:16 am
Hi,

Is there anyway to get the ID of a record I just added to the database and adD it into another table as a cross reference?

AstarothSolutions
Aug 7th 2007, 6:30 am
Assuming you are using MS SQL Server the select command to get the primary key of the record is SELECT SCOPE_IDENTITY() AS theid.