In Azure Data Factory, I have to write the foldername and the count of files in folder in sqldb.
I wrote this statement inside the lookup activity
create table dbo.sqldb12(name char(20), count int),
insert into sqldb12
values ('@{item().name}', @{int(activity('Filter1').output.ItemsCount)})
select * from sqldb12
item().name
is the output of foreach activity which is basically a foldernames
(activity('Filter1').output.ItemsCount
-- this activity will return the counts
Do you know why I am getting this error?
The error message is self explanatory. Since you are running the look up activity within for iteration, the create table query on 1st iteration would create a table but in subsequent iterations would throw an error stating it already exists