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

incrementing

Status
Not open for further replies.

manicleek

Technical User
Jun 16, 2004
143
GB
I have a db table and I'm wanting to add a new column
'marref' and in that I want to put a reference number.

i.e.

mar00001
mar00002
mar00003

etc...

obviously I don't want to type each one individually, so can anyone tell me the sql code I will need
 
you'd be better off asking this in the forum for the dbms you're using

i'm not sure ANSI SQL even allows for autonumbers

best bet is to create an autonumber column, then declare a view on the table so that you get the prefix attached to the numebrs

rudy
SQL Consulting
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top