Basit Khan

Basit Khan

  • NA
  • 336
  • 120.9k

AutoGenrate Number in SQL.

Aug 31 2015 2:34 AM
I have table called "Call" the columns are CallNo, CallNumber<nvarchar(500)>, CallDate

What i When Call being enter CallNumber should genrate 000001 so on depend upon CallNo.

I used in computed Column Specification Formula, ('00000'+right(CONVERT([nvarchar](250),[CallNo],(0)),(5)))

If CallNo=1 then i shows 000001
but if Call No=100 then shows 00000100

digit are increase. i do'nt want to increase digit
if Call No=100 then i shows 000100

how to do it in SQL.

Thanks
Basit.

Answers (5)