select * from openquery(
CIM_MFG_HIST,'select xxshm_method from pub.xxshm_mstr'
)
执行这条语句的时候会出现下面这个错误:
OLE DB provider 'MSDASQL' for linked server 'CIM_MFG_HIST' returned data that does not match expected data length for column '[MSDASQL].xxshm_method'.
The (maximum) expected data length is 16, while the returned data length is 18.
原因是:从ODBC读出来的数据是原来的两倍,必须进行转换!
如下:
select * from openquery(
CIM_MFG_HIST,'select convert(''varchar(32)'',xxshm_method) from pub.xxshm_mstr'
)
不过我试着执行:
select xxshm_method from openquery(
CIM_MFG_HIST,'select convert(''varchar(32)'',xxshm_method) from pub.xxshm_mstr'
)
又出现错误,真是见鬼了!不知是什么原因……