Click here to Skip to main content
15,922,523 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi All,

I have a requirement. I need to develop a SSIS package which contains the source as Excel and destination as SQl server. First day i have successfully loaded into destination. Next day in the source One new column have added. So i need add a column at destination side dynamically. Here i need to compare the source and destination columns. I need to write a stored procedure to compare the columns.

Could you please provide the Stored procedure for above scenario.

Thanks in Advance,
Madhava.
Posted

1 solution

First you transfer the tables from excel to SQL server then compare columns with the newly transferred table to the existing table, If column mismatch happen then add/delete columns.


Or else if u know the table structure(newly added column) of Your Excel, You can easily add columns to the table in SQL Server by simple ALTER Statement.
 
Share this answer
 
Comments
Madhava Ganji 14-Mar-12 6:57am    
Hi Teju,

Thanks for your response. I have tried like as you said. Can you provide the stored procedure for retrieve the data from Excel and put it into the temp table and compare the source and destination table columns.If they are not matching how to add the column in temp table and destination table.

Thanks,
Madhava

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