顯示具有 SQL 2014 標籤的文章。 顯示所有文章
顯示具有 SQL 2014 標籤的文章。 顯示所有文章

2015年7月25日 星期六

[SSAS]Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host

        原本運作正常的Cube,突然間連線時出現下面這個錯誤
Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host
        查了半天,想說我什都沒動啊,到底哪出了錯,該不會遇到什bug吧,因為用2014的,結果是個愚蠢的錯,windows account忘了勾永不過期,預設45天就過期了XD


2015年6月22日 星期一

[SSIS][PostgreSQL]Error code:0x80040E21 Description: Multiple-step OLE DB operation generated errors.

        在SSIS Project裡,我打算從PostgreSQL匯入資料到SQL Server上,然後執行時出現如下錯誤,從錯誤訊息裡得知好像是欄位型態轉換的問題

[OLE DB Destination [29]] Error: SSIS Error Code DTS_E_OLEDBERROR.  An OLE DB error has occurred. Error code: 0x80040E21.
An OLE DB record is available.  Source: "Microsoft SQL Server Native Client 11.0"  Hresult: 0x80040E21
Description: "Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done.".

[OLE DB Destination [29]] Error: An error occurred while setting up a binding for the "name" column. The binding status was "DT_NTEXT".
The data flow column type is "DBBINDSTATUS_UNSUPPORTEDCONVERSION".
The conversion from the OLE DB type of "DBTYPE_IUNKNOWN" to the destination column type of "DBTYPE_WVARCHAR" might not be supported by this provider.

        PostgreSQL該欄位上是TEXT,而SQL端對應欄位是NVARCHAR,我中間沒有加入資料轉換元件,對於異質資料轉換,我習慣在來源端就先轉掉好了,比較不容易出問題,所以直接在PostgreSQL來源端用cast轉換就好,例子如下
select id,cast(name as varchar(32)) as name from accounts
         這樣就沒再出錯囉

2015年3月23日 星期一

[SSIS][MySQL Data Provider]Error: The value was too large to fit in the ADO NET Source.

        因為得從MySQL匯入資料到SQL Server上,參考Connecting to MySQL from SSIS此篇,設好ADO NET Source後,測試一下出現如下錯誤

2015年3月5日 星期四

[SSIS]Warning: Could not open global shared memory to communicate with performance DLL; data flow performance counters are not available.

Warning: 0x80049304 at Data Flow Task, SSIS.Pipeline: Warning: Could not open global shared memory to communicate with performance DLL; data flow performance counters are not available.  To resolve, run this package as an administrator, or on the system's console.

        印象中以前用BIDS或SSDT沒看過這警示訊息,但用VS 2013設計SSIS專案時就看到這個警示,解法就如訊息中說的右鍵[以系統管理員的身分]執行,就不會出現囉


[SSIS]OLE DB Source連Oracle的錯誤Cannot retrieve the column code page info from the OLE DB provider.

Cannot retrieve the column code page info from the OLE DB provider. If the component supports the "DefaultCodePage" property, the code page from that property will be used. Change the value of the property if the current string code page values are incorrect. If the component does not support the property, the code page from the component's locale ID will be used.

        就在我按下Preview或是Columns時

2014年6月23日 星期一

使用sp_testlinkedserver檢查Linked Servers是否正常

        有個需求要建Data Mart,然後我打算用PowerPivot讓User可以自己取得最新資料來分析,那驗證這端怎麼弄,因為有AD就簡單很多,可是來源DB在MySQL上耶,那就想辦法把Data Mart建在SQL Server上囉,因為資料量目前不過百萬筆,預估三年內應該不會破千萬,目前容量也不到1G,使用SQL 2014 Express應該足夠

        因為要ETL到SQL Server上,才發現Express不支援SQL Server Agent,只好用工作排程器加SQLCMD來解決

        在SQL Server上建Linked Server到MySQL很簡單,但在ETL的過程中有時會遇到錯誤


        怪的是時好時壞,才想說有沒有測試Linked Server的工具呢,原來微軟早就提供sp_testlinkedserver啦,怎麼用?如下

BEGIN TRY
    
     EXEC sp_testlinkedserver  N'LK_MEM';

     TRUNCATE TABLE [dbo].[test];
     INSERT INTO [dbo].[test]
     SELECT * FROM OPENQUERY(LK_MEM,'SELECT id FROM test.t1;');

END TRY
BEGIN CATCH
     PRINT ERROR_NUMBER()
     PRINT ERROR_MESSAGE()

END CATCH

        很簡單