2018年7月18日 星期三

informix openquery error The scale exceeded the precision.

在SQL SERVER 2000上,讀取一段OPENQUERY SQL,資料來源為informix 11.50,ODBC為IBM INFORMIX 3.82 32BIT。

select *  from openquery(testdb,'select * from testtable')出現以下錯誤。
OLE DB Provider 'MSDASQL' 提供資料行 'colxxx' 無效的中繼資料 (Metadata)。The scale exceeded the precision.

來源資料表中,有一欄位colxxx的型態 為decimal(14,0),透過OPENQUERY讀取時,有上述錯誤。

解決方法有二個
1.在SQL SERVER 2000所在主機ODBC,於Advanced頁籤中勾選Describe Decimal Floating Point as SQL_REAL/SQL_DOUBLE。
2.將SQL改寫如下,select *  from openquery(ifx220 'select  colxxx::integer as colxxx from testtable'),先轉型為SQL SERVER可接受的欄位型態。

離線安裝SSMS 22 launched extracted application exiting with result code 0x138b

SSMS 22 安裝器下載頁面 https://learn.microsoft.com/zh-tw/ssms/install/install https://aka.ms/ssms/22/release/vs_SSMS.exe 將安裝檔下載到本機,檔案好大2.5G  https:...