How to send data from table to text file by date

  • please recommend me how to send data ny created date within 2 years to text file. Thank you

     

     

  • bcp out

  • Can you please provide examples, like select data with created date by 2 years and insert to csv on certain drive.

     

    Thank you

  • A question though.... what is the ultimate use of the text files?  What is going to use them and how?

    The reason I ask is a whole lot of people export data to do something because either don't know how to do it in T-SQL or don't even know it can be done in T-SQL.

     

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

  • Just in case you're still around, the reason I'm asking is because, if the ultimate use is to import the data into another SQL Server, using BCP Out in the "Native" format is your best bet especially where performance is concerned.

    BCP = "Bulk Copy Program" and its a powerful command line utility that can do a lot of really cool things with a little study and practice.  I use it instead of SSIS.

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

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