question

pravad avatar image
0 Votes"
pravad asked LodewijkWiggers-2330 commented

ADF copy data to SQL from array variable

In ADF pipeline am constructing JSON Array variable with multiple records. Is there any way to copy activity to Azure SQL from JSON Array variable? How do I map columns in Copy Activity mapping from this array?

Thanks,
Raj

azure-data-factory
· 3
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @PraveenAvadutha-9591 ,

Following up to check is below provided answer by @NandanHegde-7720 helps you? If yes, Please Accept Answer. Accepting answer may help community too.

Please let us know if any further queries. Thank you.

0 Votes 0 ·

Hi @PraveenAvadutha-9591 ,

Just checking is below provided answer by @NandanHegde-7720 helps you? If yes, Please Accept Answer. Accepting answer may help community too.

Please let us know if any further queries. Thank you.

0 Votes 0 ·

If you want to write the content of a variable of type Array, there is a workaround which works fine. Goal: write content of your array as 1 line per value of the array into a file

variable : [ a, b, c]
to
file content:
a
b
c

Steps:

  1. Create an 'empty' file with 1 row , can be a json file or something else with just 1 row

  2. Use the Copy Data activity with the single row file as source and your sink your target file

  3. Use the additional column mechanism

  4. Expand-join-with-carriagereturn the array variable with use of @join and @decodeUriComponent -> @join(variable,decodeUriComponent('%0A'))


Yes, it is a flaw that Microsoft doesn't have an @char(int) function to create a special character.(or I am an idiot and doesn't know the right way to concat an '\n' , which I tried but didn't work.)





0 Votes 0 ·

1 Answer

NandanHegde-7720 avatar image
0 Votes"
NandanHegde-7720 answered
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.