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!

Identity Field

Status
Not open for further replies.

ronmon

IS-IT--Management
Feb 25, 2002
66
IE
I want to be able to auto increment a column when a new row is added. Now i can do it numerically i.e. 1,2,3,4 but is there anyway to put in a text before the number i.e. inv01, inv02, inv03, inv04

 
The text can be added at presentation.

select 'inv' + right('00'+convert(varchar(2),id),2) from tbl

You could also create a computed column to do this.

What happens when you go past 100?

======================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top