Cast value of the Additional Column in Copy Activity

hannaS 201 Reputation points
2020-11-13T23:16:17.313+00:00

Hi,

I am copying data from SQL server to Parquet file in blob and then to Synapse. I need to fetch an additional column from another table in Synapse and add it to the destination (auditID). My stored procedure handles this. I am using Additional columns feature to get the value from Lookup activity and pass it to the Sink, however, the value is returned as String and I need it to be int. Casting it in Additional Column value field gives me a warning. In the Mapping section it does not allow to change data types. How can I make sure that the column is copied as type int and not String?

39708-image.png

39803-image.png

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

Accepted answer
  1. hannaS 201 Reputation points
    2020-11-24T19:51:16.317+00:00

    Hi @HarithaMaddi-MSFT ,

    Sorry for a late response. I have found a different solution to the problem. Instead of using additional column I am doing SELECT statement and casting the value in it. Please see picture
    42219-2020-11-24-11-28-54-window.jpg

    1 person found this answer helpful.

1 additional answer

Sort by: Most helpful
  1. HarithaMaddi-MSFT 10,136 Reputation points
    2020-11-16T07:54:31.82+00:00

    Hi @hannaS ,

    Welcome to Microsoft Q&A Platform. Thanks for posting the query.

    Though it is showing the warning over there, this conversion is working fine and pipeline is not failing unless there are any data issues. Please try executing the pipeline and let us know in case of any errors. Below is an repro of the same.

    40061-castadditionalcolsadf.gif

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

    • Please accept an answer if correct. 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.

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.