Export datedata to text file

  • Hi,

    How to export datedata to text file without 00:00:00. ?

    For ex. normally if we use export wizard in SQL enterprise manager SQL, then we get for ex. "31-12-2003 00:00:00". But I just want "31-12-2003" in the text file.

    Thanks in advance.

    - Loi -

  • Easy and clean cut. Just modify a bit of your query like below:

    SELECT CONVERT(VARCHAR, mydate, 105) AS MYNEWDATE FROM TBL1



    Regards,
    kokyan

  • Hi Kokyan,

    Thanks for your reply.

    Are there any methods by scripts to export the data to a text file?

  • Hi Loi Tan Vo,

    Try to use bcp (bulk copy). Refer to BOL for the syntacs and options (including in CSV or other formats).

    Besides, you can try the Data Transformation Services (DTS). This tools provided as one of the great feature in SQL Server 2000. For this kind of transformation, we always prefer DTS because we can format the results and add other features, such as validation or mapping.

     



    Regards,
    kokyan

Viewing 4 posts - 1 through 3 (of 3 total)

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