Click here to Skip to main content
15,880,392 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
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.
Posted
Updated 9-Mar-20 0:44am

1 solution

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.
 
Share this answer
 
Comments
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, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900