Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to use a sequential number in asp.net application

Status
Not open for further replies.

taree

Technical User
May 31, 2008
316
US
I was asked to create a small application to insert the new vendor to the database. First I need to do search if the vendor exit in the database and then I will enter the information to the database.I was asked to use a sequential number for the vendor Id which is the primary key of the vendor table. I am not sure how I can use a sequential number and Is this something the dba set up for me. please help

thank you
 
Like Mark said, if you are using SQL Server, they have a column type of "identity". This is what you want to use as the Primary Key for the table.
If you are not comfortable doing this, and have a DBA, then contact them to create the table for you.
 
Thank you guys for your help. My database is oracle and I am googling to learn about sequence.
 
PK are usually managed by either the data access layer using GUID, continious GUID (guid.comb) or a HiLo algorithm. or by the database using identity, sequence, triggered PK, etc.

In either case defining the PK should have been defined from the beginning of the project and not code that should be scattered throughout the application.

Jason Meckley
Programmer
Specialty Bakers, Inc.

faq855-7190
faq732-7259
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top