BCP Output - Remove milliseconds part

  • Hi All,

    I The requirement is to unload all columns data into csv file using bcp with pipe delimitter, but the condition is to remove milliseconds part of a datetime column.

    Ex:

    2014-02-19 17:12:14.967 remove .967 from data while unloading into csv.

  • SQListic (4/18/2014)


    Hi All,

    I The requirement is to unload all columns data into csv file using bcp with pipe delimitter, but the condition is to remove milliseconds part of a datetime column.

    Ex:

    2014-02-19 17:12:14.967 remove .967 from data while unloading into csv.

    So write a view that shows the output you want and BCP from that.

    --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 2 posts - 1 through 1 (of 1 total)

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