• No, the dataset is not of fixed length and format. there may be a length of 1 and then there may be 116. So I go by proposed solution of Cadavre.

    Jeff Moden (2/20/2013)


    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.

    Online Trainer For SQL DBA and Developer @RedBushTechnologies with 18 yrs exp.