Click here to Skip to main content
14,601,122 members
Rate this:
Please Sign up or sign in to vote.
I have a ssis package where it reads a folder with csv files and transform those files into sql server table. at the same time those csv files are moved to an archive folder. If there is any file with wrong extension or file format against the defined sql server table, it is moved to another folder named error folder. I need to conduct unit testing to this package and validating the file format against the table without using any external tools.

What I have tried:

I have completed the extracting data and loading data into the sql server table,moving the csv files corresponding to the table into the archive folder and file with the wrong extension to the error folder.
Updated 9-Mar-20 0:44am

1 solution

Rate this:
Please Sign up or sign in to vote.

Solution 1

You could load the excel file and the database table's schema into separate ADO datatables, and then compare the schemas between the datatables. Depending on how extensive your data type discovery is during the import process, you could also validate data types.
Member 13958707 9-Mar-20 10:30am
is it done by using visual ssdt?
#realJSOP 10-Mar-20 19:07pm
You can write a ssis package or SQL Server CLR assembly to do it.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100