ASP and auto-generated primary keys
I have an ASP application that accesses an SQL Server 2000 database.
On one of my ASP pages, I want to create a NEW record in a table, and IMMEDIATELY (i.e. in later code on that same page) have access to the primary key of that record.
If I use a primary key that is an auto-generated number (in the database) it seems that my ASP cannot immediately know what that number is. I am therefore forced to use non-auto-generated primary keys in the table, and generate the primary key of the new record manually in the ASP, so that I immediately know what it is.
Is this correct, or is there a better way? Am I missing something? I would prefer it if I can always use auto-generated primary keys in my tables.
Hope you can help.
P.S. The auto-generated primary keys that I am taking about are sequential integers.