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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I create a column that automatically increments

Status
Not open for further replies.

5amYan

IS-IT--Management
Oct 14, 2002
6
US
I need a value preferably Hex but int is fine that automagically increments with each new row.

I know this is simple but it will be my first database ever.

TIA
reed

5amYan
4.6692016090
-- Last line of authors current message --
 
You could make a column be 'serial'. This is an autoincrementing integer. If you want to make it hex- you would probably need to look at how serial is implemented and then roll your own with triggers or something- but I could be wrong there. But I would start by taking a look at serial and working from there.

 
use serial as stoolpigeon said and then when you fetch the value, just convert it to HEX
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top