Invalid timestamp literal detected - mysql

When trying to migrate my data from MS SQL to mySQL, essentially converting one database to another I get the following error:
[WRN][copytable]: Invalid timestamp literal detected;"
I've attached a screenshot of what I am getting when using WorkBench. Why would this be occuring? Size of database is 10438MB
configured at my local system with SQL SERVER 2008 R2. I had tried many
freeware utilities for this purposes but failed to do so. Last time i
tried using MySQL workbench to convert this database but again failed. I
tried selection based table conversion as well as the complete database.

Quote:
Datetime - In MYSQL datetime does not contain milliseconds. The SQL
Server datetime datatype contains milliseconds. Error: “Invalid
timestamp literal detected” error. Solution: Convert the datetime
type to a smalldatetime in SQL Server if you do not mind losing the
milliseconds.
from here.

Related

Conversion from Mysql to oracle using Sql developer for oracle version 19c getting errors

I am trying to convert mysql (verison 8) data into oracle(19c) using sql developer but I am getting errors for most of the tables such as inconsistent datatypes: expected DATE got NUMBER :
I am having created date column with datatype timestamp in mysql while converting I am getting this error.Can anyone help with any tool which could handle this or for sql developer am I missing something ?

Coldfusion and mySQL 5.6.41 returning datetime errors due to extracted format 2021-02-07T15:32:54

I am getting errors in Mac OS Coldfusion 2016 reading a mySQL 5.6.41 database with field type of datetime. A simple cfquery select * with cfdump produces java class error "java.time.LocalDateTime" on the datetime fields while producing expected data output in all other fields.
Attempting to output the field value as text, it returns the date/time with a T separator '2021-02-07T15:32:54' (which could be parsed).
But no ColdFusion date/time functions work due to this format.
The data was exported from mySQL 5.6.19 via SQL export using Sequel Pro and imported into the new 5.6.41 instance. All code runs fine on the previous server. I have attempted using the installed mySQL 5 datasource in ColdFusion and a JDBC driver. Both connect fine, but produce same DATETIME format.
Changing the field type to DATE or TIMESTAMP allows the CFDUMP to display without error in the DATETIME fields (obviously minus TIME if DATE).
There is a large amount of labor/overhead involved to not be able to keep DATETIME working as built (plus I believe its the correct field type). I have run out of google options and hoping someone can explain the difference and reason and solution the Coldfusion 2016 will not query data in the same manner as similar code/server.
The only way I solved this was to remove mysql-connector-java-8.0.28.jar and replace it with an older version - mysql-connector-java-5.1.38-bin.jar in my case. So, the problem comes from the mySQL connector.

SSIS - Execute SQL Task > Date conversion issue when passing DateTime variable as parameter

Brief background of the system:
Using an SSIS package to move data from SQL Server to MySQL.
I use an OLE DB connection to connect to SQL Server.
I use an ODBC Unicode connection to connect to MySQL.
Most of the system works, but I am having a date conversion issue when passing an SSIS Variable into an Execute SQL Task. It attempts insert a date into a table on the MySQL database. I get the following error when trying to enter a date of {1/1/2010 12:00:00 AM}.
"[Execute SQL Task] Error: Executing the query "Insert into ETLDate values(?)" failed with the following error: "[MySQL][ODBC 5.3(w) Driver][mysqld-5.7.22-log]Incorrect datetime value: '-10165-58296-9719 16613:13824:2136' for column 'LastETLDate' at row 1". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly."
The date is consistently '-10165-58296-9719 16613:13824:2136' so I know the value is getting passed correctly, it's just converted or encoded differently. Here is my setup for the parameter.
Some final notes:
I've tried all the other date data types for the parameter and I get the same issue.
I've tried with just a direct insert statement using the parameter and not a stored procedure and I get the same issue.
All data flow tasks that move data (which includes dates) from the SQL Server DB to the MySQL database work fine.
If create a similar stored procedure and table on the SQL Server DB (with updated parameter settings for the OLE DB connection) it works fine.
Any one know why the date is getting passed incorrectly or have a work around for this issue?

Migration of Data from Oracle database to SQL Server

[ADO NET Destination [2]] Error: An exception has occurred during data insertion, the message returned from the provider is: SqlDateTime overflow. Must be between 1/1/1753 12:00:00 AM and 12/31/9999 11:59:59 PM.
I don't understand the error message from SSIS. Please I need help.
Thanks
In C#, when the data is converted from NULL to DateTime, the DataTime.MinValue = 0001-01-01, but in database, the min value is 1/1/1753, so you have to make some treatments to NULL, otherwise when inserting 0001-01-01 (converted from NULL), it will throw you that error.
It is probably problem with different date formats on both sides, maybe different language setting for both databases. For example Oracle uses dd-MM-yyyy and SQL expects MM-dd-yyyy. Try to select datetime fields from both databases to check the format. Then try to solve it by some type of conversion in SSIS. You can try converting Oracle date to universal datetime format and then converting back to MS SQL date format. Of course, SSIS should solve it automatically, but working with dates is often buggy and confusing.
The other possibility is, that you are trying to convert TEXT column in Oracle to datetime column in MSSQL and one of the values in the table does not fit expected date format.

informatica Datetime conversion to SQL server Timstamp

I have a requirement where I have to load Informatica SESSSTARTTIME(datetime) to SQL server timestamp. When I am trying to connect datetime to timestamp I am getting error incompatible data type. 
Any suggestions how this can be achieved? 
Thanks
I had a similar issue in the past, where the date column was not getting loaded because of the difference in precision of date/time used by Informatica and SQL server. You can try this workaround: Change the data type in the target definition (not in SQL Server table, only in Informatica Target definition) to String, then Informatica will pass the date/time value in quotes when firing the insert query, which SQL server can convert to date/time automatically.
in the mapping try to create output port in expression as sessionstarttime (which is a inbuilt variable) and pass it to target
hope this will help to get desire output
in session there is config tab where you can change the format for date and time
MS SQL Server timestamp datatype has nothing to do with time. It's an autogenerated number and you cannot load it.
https://msdn.microsoft.com/en-us/library/ms182776(v=SQL.90).aspx
quote:
"Is a data type that exposes automatically generated, unique binary numbers within a database. timestamp is generally used as a mechanism for version-stamping table rows. The storage size is 8 bytes. The timestamp data type is just an incrementing number and does not preserve a date or a time. To record a date or time, use a datetime data type."