4
Answers

How to change the format of a auto generated ID column

Saroj Kumar Sahu

Saroj Kumar Sahu

11y
1.3k
1
Hi,
Can anyone tell me How to change the format of a auto generated ID column in Sql server as
if ID is 1 i want to make it 001-01,
2 to 002-01,
3 to 003-01 ...so on.
but i want this in Select Query without creating any column for this format.
and if my ID is 10 digit ?means if My ID is 12456 then is it make any reflect ?actually if my ID is 1 or 2 digit then i want to add 0 otherwise not.
Any help will be appreciated. Thanks in advance Smile | Smile | :)
Answers (4)