3

I'm using SSIS 2008 to extract data from SQL Server, grab fields from other databases along the way, do a derived column to convert strings and a data conversion transform before storing the output to a text file.

Somehow along the way, the EncounterNumber field is being duplicated. The output columns metadata from the data conversion transform to the flat file destination shows this field twice. The error I'm getting when trying to map fields into the flat is as follows:

Error at Data Flow Task [Flat File Destination [44524]]: There is more than one data    
source column with the name "Encounter Number".  The data source column names must be 
unique.

(Microsoft Visual Studio)


===================================

Exception from HRESULT: 0xC0207015 (Microsoft.SqlServer.DTSPipelineWrap)

------------------------------
Program Location:

at 
Microsoft.SqlServer.Dts.Pipeline.Wrapper.CManagedComponentWrapperClass.
ReinitializeMetaData()
at 
Microsoft.DataTransformationServices.DataFlowUI.
DataFlowComponentUI.ReinitializeMetadata()
at 
Microsoft.DataTransformationServices.DataFlowUI.FlatFileDestinationUI.conn
Page_SaveConnectionAttributes(Object sender, FlatFileConnectionAttributesEventArgs   
args)

Is there an error output or some other way of handling the duplicate Encounter field so that the fields can be mapped into my flat file destination?

Update: Here's a screen shot of the data flow: enter image description here

The metadata from the data conversion is as follows:

"Name"  "Data Type" "Precision" "Scale" "Length"    "Code Page"   
"Encounter Number"  "DT_STR"    "0" "0" "20"    "1252"  "0" ""    
"OLE DB Source"
"Encounter Number"  "DT_WSTR"   "0" "0" "20"    "0" "0" ""    
"Data Conversion"

How do I remove the Data Conversion or OLE DB Source version of the Encounter Number? Is this a setting somewhere?

4

2 回答 2

4

如果源文件中有两列同名,则可以在连接管理器中更改,例如,如果源文件是文本或 csv,则在平面文件连接管理器中,在高级选项卡中,您可以更改列并加载数据。如果源文件中的两个不同列具有相同的列名,这将起作用。

于 2017-05-31T19:04:48.143 回答
1

不,但是找到两个以 Encounter 作为列名的查询并更改其中一个以返回不同的列名应该不难。

于 2013-11-01T18:51:01.763 回答