Transact-sql for changing a telephone number

  • Spikemarks (3/11/2009)


    I have tweeked the code and have put it inside a cursor which should read the first 3 chars and then change to which ever it should be.

    Once I have tested etc I will post for other people to use.

    Beer in post!

    Heh... now why would you mess up some nice set based code with a cursor? 😉

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • aram_golbaghi (3/11/2009)


    hi

    i think gsquare's solution is verywell,

    works fine

    Yep... right up until you dial a 1 or 3 digit country code instead of +44.

    Country codes can be from 1 to 3 digits.

    City codes can be from 0 to 4 digits.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

Viewing 2 posts - 16 through 16 (of 16 total)

You must be logged in to reply to this topic. Login to reply