Country Codes - Return Data

  • Our client would like a two character country code returned from our data but we are storing country codes as three characters. We do have a 'country' table and I was thinking that I might have to add a new column to the table for the two character format and then reference the data in that column. I also thought that I might be able to do a substring on the existing values but their data does not correlate well with our data. What would be the best approach for tackling this task? Any help would be greatly appreciated.

  • I would do as you said... add the extra column with the 2 character country code to the Country table .

    --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)

  • Most safest methos would be adding a columna s you said. Substring method does not gurant that it will not return same code for two differetn countries.




    My Blog: http://dineshasanka.spaces.live.com/

Viewing 3 posts - 1 through 2 (of 2 total)

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