none
Import .csv file with date time stamp standard using SSIS

    Dotaz

  • I tried to create .csv file with date timestamp like "XXX_2018-07-11-09.12.33.731000.csv" but I can able to create the file name till seconds using SSIS.

    How to get .csv file name mentioned below using SSIS?

    Ex: XXX_2018-07-11-09.12.33.731000.csv

    čtvrtek 12. července 2018 8:08

Odpovědi

  • Assuming its the system datetime value you want upto this level of precision what you can do is to add a string variable in SSIS (@[User::CSVFileName])and set it to an expression like below

    "XX_" + LEFT((DT_WSTR, 30)(DT_DBTIMESTAMP2,7) GETDATE(),26) + ".csv"

    Then use this variable to set your dynamic CSV filename by appending the path value before filename and mapping it to connectionstring property of your flat file connection manager used to point to your CSV file.


    Please Mark This As Answer if it solved your issue
    Please Vote This As Helpful if it helps to solve your issue
    Visakh
    ----------------------------
    My Wiki User Page
    My MSDN Page
    My Personal Blog
    My Facebook Page

    čtvrtek 12. července 2018 8:57

Všechny reakce

  • Assuming its the system datetime value you want upto this level of precision what you can do is to add a string variable in SSIS (@[User::CSVFileName])and set it to an expression like below

    "XX_" + LEFT((DT_WSTR, 30)(DT_DBTIMESTAMP2,7) GETDATE(),26) + ".csv"

    Then use this variable to set your dynamic CSV filename by appending the path value before filename and mapping it to connectionstring property of your flat file connection manager used to point to your CSV file.


    Please Mark This As Answer if it solved your issue
    Please Vote This As Helpful if it helps to solve your issue
    Visakh
    ----------------------------
    My Wiki User Page
    My MSDN Page
    My Personal Blog
    My Facebook Page

    čtvrtek 12. července 2018 8:57
  • Thanks for your answer. Now I am able to get the file name like "XXX_2018-07-11-09.12.33.731000.csv".
    pátek 13. července 2018 14:22