Hello ,
I am sharing an implementation below , i am assuming that when you mention data lake , you mean data lake storage . Please allow me to give the background of the implementation , when ever the copy activity completes , we have some properties which are exposed regarding the rows copied etc , we will use that . Also there is no ADF function which will tells in the rows in a a file .We can use Azure databricks etc to get that , but thats a different implementation .
How to get the Raw count
Since you mentioned that you are coping the data from SQL to csv , you can use the property directly .
**How to get the Raw count on the distination file **
We are copying the distination file to a dummy file , once we do that we can use the properties and then delete the dummy file .
We will take the row count in both the cases and insert into a table .
Dynamic expression used @{int(activity('COPY the main file to dummy file').output.rowsCopied)}
SQL Script
CREATE TABLE Logging
(
RowsReadfromSmallerFile int
,RowsReadfromBiggerFile int
,InsertedTime datetime default getdate()
)
GO
ALTER Procedure Ins_Logging
@RowsReadfromSmallerFile int
,@RowsReadfromBiggerFile int
as
INSERT INTO Logging (RowsReadfromSmallerFile,RowsReadfromBiggerFile)
values (@RowsReadfromSmallerFile,@RowsReadfromBiggerFile)
Thanks Himanshu
Please do consider to click on "Accept Answer" and "Up-vote" on the post that helps you, as it can be beneficial to other community members