I have a phonenumber field stored as nvarchar. I need to cycle through these numbers incrementing them by one each time. My original idea was to convert them to an int and then add one to the int ... but for phone numbers starting with 0 like 01923 .... it gives me 1923, the phonenumbers are never going to be a fixed length of characters, they will most likely to be between 5 and 25.
What I am now planning on doing is finding the len of the phone number and if it is one more than the integer conversion of it, add a 0 to the start. But to me this seems a bit clumsy ... is there any better way? i.e. can I somehow store the phonenumber as a number and still keep the 0 at the start. Or can I somehow, based on the len of the field define a format for it ... like visual basic?
Hope you can help