MySQL链接服务器

时间:2018-06-08 06:58:42

标签: mysql sql mysqli

我尝试从我的SQL Server向远程MySQL插入一些记录。 MySQL作为链接服务器连接。

我运行的脚本是:

INSERT INTO OPENQUERY(LINKSERVER1,'select virtuemart_category_id, category_name, category_description, metadesc, metakey, CustomTitle, slug, ERPCode from rszcf_virtuemart_categories_el_gr') 
(virtuemart_category_id, category_name, category_description, metadesc, metakey, CustomTitle, slug, erpcode) 
SELECT AA1, Category_Name1, Category_Description1, Metadesc1, Metakey1, CustomTitle1, slug1, ERPCode1 FROM EGM_WEB_Categories_el_gr T1
WHERE NOT EXISTS 
(
  SELECT 1 
  FROM OPENQUERY(LINKSERVER1,'select virtuemart_category_id, category_name, category_description, metadesc, metakey, CustomTitle, slug, erpcode from rszcf_virtuemart_categories_el_gr') T2 WHERE 
  T2.erpcode = t1.ERPCode1 collate Greek_CI_AI
)

我总是得到这个错误:

  

OLE DB提供程序" MSDASQL"对于链接服务器" LINKSERVER1"无法插入表格#34; [MSDASQL]"因为列" category_description"。   由于符号不匹配或溢出以外的原因,无法转换数据值。

在MySQL中,category_description字段为VARCHAR(19000),在SQL Server中为nvarchar(255)。

如何传递此错误?有什么帮助吗?

0 个答案:

没有答案