I have marked a column as Identity in my table
create table Identitytest(
number int identity(1,001) not null,
value varchar(500)
)
I need the identity column to be incremented as 001,002,003, etc.
The database shows that it is inserting as 1,2,3, etc.
How can this be done?
If you want to display your
numbercolumn with leading zeros, just pad it in yourSELECTstatement. It’s a number, it will NOT store with leading zeros as an integer.The
3is the number of characters you want total in the output display.