Share via

Copy Activity Hardcode a column value Excel in data lake to SQL Server

Debbie Edwards 36 Reputation points
2020-10-01T13:14:49.723+00:00

I have an extra column in my SQL Sink destination table called Validation type

When I copy the data from the Excel source I simply want to hardcode the work Validated into this column

I tried adding in 'validated' but got the following error

Message=Invalid column name ''Validated'' is specified while read data from worksheet

I don't want to use a data flow because it should be simple in the copy activity

I thought I could add it to the data set schema but it doesnt look like you can add an extra column there once you have imported schema

Is there any way that I can do this in the copy activity?

29579-validationstatus.jpg

Azure Data Factory
Azure Data Factory

An Azure service for ingesting, preparing, and transforming data at scale.

0 comments No comments

1 answer

Sort by: Most helpful
  1. KranthiPakala-MSFT 46,827 Reputation points Microsoft Employee Moderator
    2020-10-01T15:30:54.533+00:00

    Hi @Debbie Edwards ,

    Thanks for your query. Just wanted to check if you have got a chance to explore "Add additional columns during copy" feature in copy activity. This feature can be used to add additional data columns to copy along to sink.

    29597-image.png

    Below are few scenarios where you can utilize this feature:

    • When copy from file-based source, store the relative file path as an additional column to trace from which file the data comes from.
    • Add a column with ADF expression, to attach ADF system variables like pipeline name/pipeline ID, or store other dynamic value from upstream activity's output.
    • Add a column with static value to meet your downstream consumption need.
      29655-image.png

    Please let us know how it goes.
    Thank you

    Was this answer helpful?


Your answer

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