• GAURAVKAUSHIK26 (9/9/2008)


    You can define cr/lf delimiter for getting data in rows. As far as columns are concerned, you can use substring function of sql to create and fill columns. eg: if you need to spilt 'goodluck' into 2 columns - good|luck

    col1 = substring(columnName,starting position,length)

    col1=substring(ColumnName,1,4).....will give 'good' from column columnName which can be filled into new created column..

    Yep, that would work, as well, and it'll be pretty fast. But a Bulk Insert using a BCP Format file would be faster.

    Still waiting on the OP to attach a sample file and the CREATE statement for the target table, though...

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