CSV File Name

Rohit Kulkarni 691 Reputation points
2022-02-24T08:26:44.15+00:00

Hello Team,

I am running a query from SQL Server and storing the data in csv file in the Azure Blob Storage. The Filename is VisualAcuity.But i need to store the file name as

VisualAcuity_Run(OnwhichDayPipelineRanDate)_Ending(PreviousMonthEndDate).csv.How i can pass the dynamically .

Example :VisualAcuity_Run01Feb2022_Ending31Jan2022.csv

Please advise

Regards
Rk

Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
10,694 questions
{count} votes

1 answer

Sort by: Most helpful
  1. AnnuKumari-MSFT 32,906 Reputation points Microsoft Employee
    2022-02-24T09:07:32.473+00:00

    Hi @Rohit Kulkarni ,
    Thankyou for using Microsoft Q&A platform and posting your query.
    As I understand your query, you want to copy data from SQL server to Azure blob storage and want to define the target file in the below mentioned format: VisualAcuity_Run(OnwhichDayPipelineRanDate)_Ending(PreviousMonthEndDate).csv

    These are the steps that will lead you to the desired output:

    1. Use Copy activity and point the source to SQL Server Dataset
    2. Use Azure Blob storage dataset in Sink tab . Provide the desired folder name (as you haven't mentioned I am assuming it can be hardcoded) and use the following dynamic code in FileName:
      @concat('VisualAcuity_Run',formatDateTime(utcnow(),'ddMMMyyyy'),'_Ending',adddays(startOfMonth(utcnow()),-1,'ddMMMyyyy'),'.csv')  
      

    Attaching gif for reference:
    177348-sqltocsv.gif

    Hope this will help. Please let us know if any further queries.

    ------------------------------

    • Please don't forget to click on 130616-image.png or upvote 130671-image.png button whenever the information provided helps you.
      Original posters help the community find answers faster by identifying the correct answer. Here is how
    • Want a reminder to come back and check responses? Here is how to subscribe to a notification
    • If you are interested in joining the VM program and help shape the future of Q&A: Here is how you can be part of Q&A Volunteer Moderators

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.