2017-06-24 39 views
1

在我的開發機器中,我安裝了MS excel。我可以通過SSIS(Visual Studio)將數據從數據庫導出到數據庫中。但是當我將其部署到未安裝MS excel的質量保證環境時,該包失敗,出現以下錯誤。如果真的需要在目標機器上安裝MS excel軟件,同時通過SSIS將數據從數據庫導出到excel,請幫助我。是否需要在目標機器上安裝MS excel軟件,同時將數據從SSIS導出到excel

這是我正在使用的查詢在excel工作表中創建excel和選項卡。 創建excel文件並在其中插入「新建」選項卡。用於上述腳本

CREATE TABLE Inserted(

[fileid] integer 
     ,[filename] string 
     ,[rxcui] string 
     ,[tty] string 
     ,[rxnorm_description] string 
     ,[related_brand_name] string 
     ,[related_scdc] string 
     ,[related_df] string 
     ,[related_ndc] string 
     ,[create_date] date 
     ,[create_user] string 
     ,[status] string 
     ,[plan_year] string 
     ,[update_date] date 
     ,[update_user]string 
) 

連接管理器:

@[User::var_excel_destination] +"\\"+"FRF_File_Import_Detail_"+ Right("0" +(DT_STR,4,1252) datepart("yyyy", getdate()),4) 
+ Right("0" +(DT_STR,2,1252) datepart("mm", getdate()) ,2) 
+ Right("0" +(DT_STR,2,1252) datepart("dd", getdate()),2)+Right("0" + (DT_STR,2,1252) DatePart("hh",getdate()),2) 
+ Right("0" + (DT_STR,2,1252) DatePart("mi",getdate()),2) 
+ Right("0" + (DT_STR,4,1252) DatePart("ss",getdate()),2) +".xls" 

它是在這個步驟與下面的錯誤失敗:

Error Description :Failed to acquire connection "ECM FRF File Import Processor". Connection may not be configured correctly or you may not have the right permissions on this connection.

請幫助。

+0

我提供了正確的答案給你的問題。 –

回答

0

我只是設置在SQL Server作業上以32位模式運行。它像一個魅力。

+0

請參閱這篇文章:https://www.google.com/amp/s/balwantpatel.wordpress.com/2015/12/09/myth-excel-connection-manager-works-only -sin-32-bit-mode-of-ssis/amp/ –

+0

好信息Jason。非常感謝你。但在我的方案中的問題是:1.我有32位安裝Microsoft.Jet.OLEDB.4.0。 2.將SSDT設置爲以32位模式運行。 3.它在SSDT中工作正常。 4.在部署並被要求通過SQL作業運行時,它失敗了。 5.我把工作的屬性設置爲「運行時間32位」,並像魅力一樣工作。 –

0

是的,它需要MSexcel安裝在系統中。沒有它我們沒有內部定義,使系統完全理解文件格式。

+0

嗨切坦,感謝您的意見,但在其中的一篇文章中說它並不是真正需要的。請參考以下鏈接以供參考。 https://stackoverflow.com/questions/19710758/ssis-export-to-excel-do-i-need-excel-on-the-target-machine –

+0

我的壞,那裏的答案說,你可能需要,如果你沒有32位系統(我有64位系統,當我做同樣的任務時,我發現,excel對於安裝在目標機上很重要) –

+0

嗨Chetan,請參考這個鏈接瞭解更多細節。 https://social.msdn.microsoft.com/Forums/en-US/c6c13caf-5a23-4b39-8c85-1bf390107393/is-it-necessary-to-have-ms-excel-software-installed-on-the- target-machine-while-exporting-data-from?forum = sqlintegrationservices –