I want to insert all CSV file rows into SQL database. I have exact same fields in both csv and database table. I setup database connection successful. I am struggling to process insert statement.
I am using for each activity to read each row and my SQL database name is “project” and table name is “dbo.dump”.
Can someone suggest what should be my query? specifically, I am not able to understand what should I write in Values in insert statement because I cannot use row.Item(0).ToString as value.
Drop Connect activity inside the sequence, Create a variable for Database Connection ,select the Provider as SqlClient, string in the property window.
Read the CSV file using Read CSV activity. Create a variable for output Data Table in the property window.
Create a variable of type Data Table and assign the value from previous step.
5.Drop For Each Row activity. give Table variable name from previous step, Loop through each row
Drop Execute Non Query activity, give connection string name created in step 2,select the provider as SqlClient,
Sql insert query “INSERT Into SqlDataTable (Column1,Column2,Column3)
values (@value1,@value2,@value3)”
8.Parameters should have the same datatype as Sql Data Table.