我想将 SQL 表 (Practice2.dbo.Adress) 中的“Street”列 (NVARCHAR(50)) 导入 Excel (ExcelDestination.xls)。我知道如何在 SSIS 中执行此操作,但在 BIML 中我似乎找不到正确的代码,尤其是在源和目标之间进行列映射。当我尝试生成 SSIS 包时,出现错误
“无法解析对 'TableResource' 类型的 'Adress' 的引用。'TableName="Adress"' 无效。提供有效的范围名称。”
这是我到目前为止所做的:
<Biml xmlns="http://schemas.varigence.com/biml.xsd">
<Connections>
<OleDbConnection Name="ConnectionWithPractice2" ConnectionString="Provider='SQLNCLI11'; Data Source='DWH'; Initial Catalog='Practice2'; User Id='system'; Password='password';"></OleDbConnection>
<ExcelConnection Name="Excel Connection Manager" ConnectionString="Provider='Microsoft.Jet.OLEDB.4.0';Data Source='C:\Users\adm-jpna\Documents\ExcelDestination.xls';Extended Properties='Excel 8.0;HDR=Yes;IMEX=1'">
</ExcelConnection>
</Connections>
<Packages>
<Package Name="Package1">
<Tasks>
<Dataflow Name="ImportIntoExcel">
<Transformations>
<OleDbSource Name="OLE_DB_Source" ConnectionName="ConnectionWithPractice2">
<DirectInput>SELECT Street FROM Practice2.dbo.Adress</DirectInput>
</OleDbSource>
<ExcelDestination Name="Excel_Destination" ConnectionName="Excel Connection Manager">
<Columns>
<Column SourceColumn="Street"></Column>
</Columns>
<TableOutput TableName="Adress"></TableOutput>
</ExcelDestination>
</Transformations>
</Dataflow>
</Tasks>
</Package>
</Packages>