How to solve error 7347 in linked server - mysql

I have two database, MySQL and SQL Server
I have created linked server between these database and I didn't have any problem but when I wanted transfer data from MySQL to SQL Server, I faced with this problem:
OLE DB provider 'MSDASQL' for linked server 'TWITTER' returned data that does not match expected data length for column '[MSDASQL].t_u_description'. The (maximum) expected data length is 30, while the returned data length is 55.
In two databases, my table and column and data type is same, but I don't know, how to solve this problem?
My data in this column(t_u_description) is non-english

Related

Not able to add into mysql database using Talend Job

While adding data into mysql database using Job, I am getting following errors
*Starting job fillraw at 16:34 10/03/2016.
[statistics] connecting to socket on port 3955
[statistics] connected
Data truncation: Out of range value for column 'Net_Value' at row 2
Data truncation: Data too long for column 'Material_Description' at row 9
...
I'm new, but with some similar error, I debugged it with examining schemes and syncing. I suggest you do the same:
compare output scheme with DB scheme
check types both in Talend and database (my case I think was Talend String mapped to DB VARCHAR, but I forgot to put the exact size for VARCHAR on DB side)
check sizes and precisions of all types (expecially if you have double / float / decimal differences)

SSIS: cannot convert between unicode and non-unicode string data types

I am working in SQL Server 2008 and BIDS (SSIS). I have a simple data flow task in which I'm importing a flat file into an OLE DB destination. On the OLE DB destination, I'm getting an error message, stating "cannot convert between unicode and non-unicode string data types".
Now, I know one solution method is to put a data conversion in between the flat file and the OLE DB destination. However, my concern is why this is even happening in the first place. In the connection manager for the given flat file, all columns are string (DT_STR) data types, and the Unicode option is unchecked. Similarly, all columns in the destination table (upon the inspection of the metadata in SSMS) are varchar data types. So, there is no nvarchar-to-varchar mapping going on at all.
Why is SSIS thinking that I have a unicode-to-nonunicode mapping happening? And, is there an easier way to resolve this than inserting a data conversion step for the columns that have this problem?
[Since I don't seem to be allowed to comment on the question, I'm having to put my question here.]
Have you checked the table you're trying to insert the data into to see if the columns in the table are varchar or nvarchar? The SSIS metadata could be out of sync with the database table.

SSIS 2008 mySQL source to SQL 2008

I need to copy data from a remote mySQL database into MSSQL Server 2008 database using SSIS 2008 package. I have some Timestamp fields in the mySQL database giving me problems. When l excluded the Timestamp fields l managed to copy the data nicely. On the OLE DB Destination Input - Input Columns the field which is Timestamp on mySQL database is showing as having data type DT_Bytes.
I am getting the error An OLE DB record is available.
Source: "Microsoft SQL Server Native Client 10.0" Hresult: 0x80040E21 Description: "Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done."
[OLE DB Destination [784]] Error: Cannot create an OLE DB accessor. Verify that the column metadata is valid.
My select statement to the mySQL source has got a select case to handle 0 dates it is like;
SELECT case modified_date when day(modified_date) = 0 then '1990-01-01 00:00:00' else modified _date end as modified from mySQLTableName
The problem is definitely with your data types. Open up your Destination component for editing. Go the mapping tab. Hover over each column mapping, first the source column, then the destination. The tooltip will show you what the data types of each column are. One of them doesn't match.
It's most likely your timestamps field, but it might not be, so I won't speculate.
In any case, to make them match, add a Data Transformation component in between your source and destination, and recast the offending source column to the data type you want for inserting into SQL Server. (If the recasting also causes an error, it'll be a lot more helpful one than this one!)

Fieldlength constraint when using linked server

I have a view in a Database that uses a Column that once had the length varchar 30 and is now updated to varchar 50.
I can execute a select directly on the database and it returns the expected results.
When I run the same query on a different server that executes the query in a linked server an error shows up:
OLE DB provider 'SQLNCLI' for linked server 'myserver' returned
data that does not match expected data length for column
'[192.168.0.107].[MyDB].[dbo].[Myview].Mycolumn'. The (maximum)
expected data length is 30, while the returned data length is 50.'
This is not an insert into a table that has a column length 30 and I have no idea where the length 30 comes from. It is realy just a select-query.

MySQL as Linked Server on SQL Server 2008 - Data Length Mismatch

I am trying to set up a third party MySQL as a Linked Server on SQL Server 2008.
When I try to access the data via a simple OpenQuery below I get an error.
SELECT * FROM OpenQuery(SERVERNAME, 'SELECT * FROM table')
The error message:
OLE DB provider 'MSDASQL' for linked server 'SERVERNAME' returned data that does not match expected data length for column '[MSDASQL].tablename'. The (maximum) expected data length is X, while the returned data length is Y.
NOTE:(where X > Y)
I've tried with another MySQL table that I built myself and it works fine. Therefore I assume the problem might be with the MySQL source.
EDIT: After digging a little deeper into the MySQL data I found several "invalid" dates such as zero dates. These could be a reason, however I have no way to change the data source so I must find a way to convince SQL to ignore it.
I recall something form previous versions of SQL where you could switch to "Lazy Schema Validation" to force SQL not to check this. However this option appears to be gone in 2008.
Any ideas how I could make this work?