Copy comma delimitted text file to a table by ascending order

  • Sergiy,

    Can you give me some idea using Select? appreciate your help

    Thx

  • He already did... 😉

    SELECT *

    FROM #NewTempTable

    ORDER BY ID

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

  • I don't want all the rows to be order by that is the thing right. i want only set of rows order by:)

    Thx

  • vkres1 (8/3/2008)


    I don't want all the rows to be order by that is the thing right. i want only set of rows order by:)

    Thx

    What in your rows groups them into sets?

    How can SQL Server tell which rows belong to one set and which to another one?

    _____________
    Code for TallyGenerator

  • sergiy,

    suppose if the C1 = 42 then end of the first set. what i want is i just want to move that row 42 above the 51 in that set so that all will be in the order like

    C1 C2 C3

    41 te ce

    42 te ce

    51 te ce

    41 te ce

    42 te ce

    51 te ce

    and so on.........

  • What about the out of place 41?

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

  • The row starts with 41

  • vkres1 (8/4/2008)


    The row starts with 41

    Heh... Ya Think? What do you want to do with it? 😉

    Have you tried the clustered index solution I gave you yet? :blink:

    --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 8 posts - 16 through 24 (of 24 total)

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