• S_Kumar_S (2/19/2013)


    Hi

    I got a dataset from somewhere which I have to store in sql server. It has one column which consists on numeric values with length 116.

    i.e. its an integer with 116 numbers. Not even bigint support this kind on length. I can't put it in varchar as i'll need to do sort operations on it.

    Are there any alternatives for this in sql server?

    thanks

    What the dataset looks like may be very important here. Since, as you identified, that the 116 digit "integer" cannot be stored in any datatype in SQL Server other than a VARCHAR, I have to ask, what does the dataset actually look like? If it's coming across as a fixed width, right justified, character based column, then just import the entire "field" including the leading spaces (or zeroes) available in the dataset and your resulting column will, in fact, be sortable.

    Otherwise, you'll need to do as what Cadavre suggested.

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