MySQL Forums
Forum List  »  Microsoft SQL Server

Loading into 'text' field
Posted by: Just Nod
Date: February 28, 2011 03:54AM

I have been successfully using a linked server under MS SQL Server 2008 R2 to upload data to a remote MySQL database. That remote database is hosted on a shared server by an ISP so I don't have many options available to manipulate the data in situ. One of the fields I upload to has recently changed from a MySQL varchar type to a MySQL text type and I now have a problem because the upload fails with the message:

The OLE DB provider "MSDASQL" for linked server "WebRemote" reported an error. The provider reported an unexpected catastrophic failure.

This MS SQL code (inserting NULL into the text item) works:

INSERT OPENQUERY (WebRemote, 'SELECT TstTstCd,TstText,TstVarChar FROM Tst') SELECT TmpKey,NULL,'a' FROM Tmp

but both of these fail with the error shown above:

INSERT OPENQUERY (WebRemote, 'SELECT TstTstCd,TstText,TstVarChar FROM Tst') SELECT TmpKey,'a','a' FROM TmpINSERT
INSERT OPENQUERY (WebRemote, 'SELECT TstTstCd,TstText,TstVarChar FROM Tst') SELECT TmpKey,cast('a' as text),'a' FROM Tmp

Does anyone have any suggestions as to how I can resolve this please? This is a MySQL 4 database.

The local Tmp table that I've been using to experiment with has one row created using MS SQL as follows:

CREATE TABLE Tmp( TmpKey varchar(15),
TmpBig text,
TmpBigger varchar(max))
INSERT Tmp VALUES ( 'a', 'a' + SPACE(998) + 'b',NULL)

Thanks in advance.

Options: ReplyQuote

Written By
Loading into 'text' field
February 28, 2011 03:54AM

Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.