I have to store isdCodes which is in format 0091 001 009751 009665 etc. in the database, the initial will basically start from zero. i tried using int as datatype with unsigned attribute but it does not seems to work. which datatype is suitable for storing this type of value?
I have to store isdCodes which is in format 0091 001 009751 009665 etc.
Share
Since the number of leading zeros matter, (i.e.,
0091≠091), I would go for avarcharin this case.If you really want to use some numeric type, I guess you could prepend a
1in front of the number to keep the zeros, but it would be a bit of a hack.