Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Export to MySQL problem

Status
Not open for further replies.

Glasgow

IS-IT--Management
Jul 30, 2001
1,669
GB
I have been successfully using a linked server to upload data to a remote MySQL database. However, 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 code (inserting NULL into the text item) works:
Code:
INSERT OPENQUERY (WebRemote, 'SELECT TstTstCd,TstText,TstVarChar FROM Tst') SELECT TmpKey,NULL,'a' FROM Tmp
but neither of these work:
Code:
INSERT OPENQUERY (WebRemote, 'SELECT TstTstCd,TstText,TstVarChar FROM Tst') SELECT TmpKey,'a','a' FROM Tmp
INSERT OPENQUERY (WebRemote, 'SELECT TstTstCd,TstText,TstVarChar FROM Tst') SELECT TmpKey,cast('a' as text),'a' FROM Tmp
Any suggestions?

The local Tmp table that I've been using to experiment with has one row created as follows:
Code:
CREATE TABLE Tmp(
  TmpKey varchar(15),
  TmpBig text,
  TmpBigger varchar(max)
)
INSERT Tmp VALUES ( 'a', 'a' + SPACE(998) + 'b',NULL)

Thanks in advance.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top