I am transferring data from MS SQL Server 2008 to MySQL using SSIS Package. I have done mapping of all the tables. But while executing the package I am getting error - Unable to cast object of type 'System.DateTime' to type 'System.Char[]'
On verification I found that my source SQL Server table contains 4 varchar columns and 1 datetime column - which is matching with destination MySQL Table.
However, I figured out my datetime column contains a few NULL values. Hence, I have made default NULL in my destination column in MySQL table as well.
When I port a sample data - set of 2 rows with NULL datetime value - it gets ported without any error.
And I tried porting data with a sample data - set of 2 rows without any NULL values in datetime column - obviously it got ported without any errors.
However, when I tried to port the data - sample data with a combination of NULL values and valid datetime values - the package fails with the above error.
So now, I have 2 dataflow tasks - the first dataflow task ports the rows with NULL values and the second dataflow task ports the rows without NULL values from the same source table to the same destination table.
But why it is failing when i port the data in a single dataflow task?
Any expert solution in this matter would be of great help as I have to port more than 40 table data between SQL Server and MySQL on a weekly basis. Hence, creating double dataflow task may not be a good idea.
Reference : My setup is exactly as mentioned in this link - http://dbperf.wordpress.com/2010/07/23/sql-server-integration-services-2008-ssis-and-mysql/
On verification I found that my source SQL Server table contains 4 varchar columns and 1 datetime column - which is matching with destination MySQL Table.
However, I figured out my datetime column contains a few NULL values. Hence, I have made default NULL in my destination column in MySQL table as well.
When I port a sample data - set of 2 rows with NULL datetime value - it gets ported without any error.
And I tried porting data with a sample data - set of 2 rows without any NULL values in datetime column - obviously it got ported without any errors.
However, when I tried to port the data - sample data with a combination of NULL values and valid datetime values - the package fails with the above error.
So now, I have 2 dataflow tasks - the first dataflow task ports the rows with NULL values and the second dataflow task ports the rows without NULL values from the same source table to the same destination table.
But why it is failing when i port the data in a single dataflow task?
Any expert solution in this matter would be of great help as I have to port more than 40 table data between SQL Server and MySQL on a weekly basis. Hence, creating double dataflow task may not be a good idea.
Reference : My setup is exactly as mentioned in this link - http://dbperf.wordpress.com/2010/07/23/sql-server-integration-services-2008-ssis-and-mysql/