Forum Discussion
Copy Activity Fabric
Hi Ka13,
Let's go through this step by step.
First, I created a metadata table in my warehouse:
CREATE TABLE metadata (
runid UNIQUEIDENTIFIER,
rowsRead int,
rowsCopied int,
CopyDuration int
)
Next I add a script activity after the copy activity:
Next, in the expression builder, I will build the expression:
@concat('INSERT INTO dbo.metadata (runid, rowsRead, rowsCopied, CopyDuration) VALUES
(''',pipeline().RunId,''', '''
,activity('Copy data1').output.rowsRead, ''','''
,activity('Copy data1').output.rowsCopied, ''','''
,activity('Copy data1').output.copyDuration, ''');' )
THis runs successfully:
and wehn I look at the warehouse, I see my run recorded:
Hope this helps.
If you found this helpful, consider giving some Kudos. If I answered your question or solved your problem, mark this post as the solution.
- Ka139 months agoHelper II
tayloramy Thanks for response.
I tested above taking output from Copy Activity and reading in the Script activity is working.
But I had the Lookup Query from Fabric Warehouse which takes the TableName from it and I wanted to add the TableName in the log table also. I tried adding the Table name as below but was getting the Error. Can you please suggest
Error - concat is primitive and does not support nested properties- tayloramy9 months agoSuper User
Hi Ka13,
You will need to reference the lookup activity the same way you reference the copy data activity. activity("Lookup Query").output.XXXX When you run the pipeline, after the lookup is successful, you can click on the output to see exactly what the lookup query is returningIf you found this helpful, consider giving some Kudos. If I answered your question or solved your problem, mark this post as the solution.