SSIS VS2012 将平面文件文本转换为布尔值

SSIS VS2012 convert flat file Text to Boolean

我正在尝试从 CSV 文件中获取数据并将记录导入到我的数据库中。我有一个 SSIS 包,它读取平面文件,通过数据转换传递它,然后将它发送到数据库。

我遇到的问题是具有 "True" "False" 或空白的字段需要转换为布尔值。该软件包过去有效,但我们已从 SQL 2008 升级到 SQL 2014,并将该软件包从 VS2008 升级到 VS2012。

错误:

Error: 2015-09-15 23:00:03.23
Code: 0xC02020C5     
Source: Data Flow Task 1 Data Conversion 0 - 0 [2]     
Description: Data conversion failed while converting column "aginactive" 
             (192) to column "aginactive" (62).  The conversion returned 
             status value 2 and status text "The value could not be 
             converted because of a potential loss of data.".  
End Error  

Error: 2015-09-15 23:00:03.23
Code: 0xC0209029      
Source: Data Flow Task 1 Data Conversion 0 - 0 [2]     
Description: SSIS Error Code DTS_E_INDUCEDTRANSFORMFAILUREONERROR.  The 
             "Data Conversion 0 - 0.Outputs[Data Conversion Output].
             Columns[aginactive]" failed because error code 0xC020907F 
             occurred, and the error row disposition on "Data Conversion 
             0 - 0.Outputs[Data Conversion Output].Columns[aginactive]" 
             specifies failure on error. An error occurred on the 
             specified object of the specified component. There may be 
             error messages posted before this with more information
             about the failure.  
End Error   

Error: 2015-09-15 23:00:03.23     
Code: 0xC0047022     
Source: Data Flow Task 1 SSIS.Pipeline     
Description: SSIS Error Code DTS_E_PROCESSINPUTFAILED.  The ProcessInput 
             method on component "Data Conversion 0 - 0" (2) failed with 
             error code 0xC0209029 while processing input "Data Conversion 
             Input" (3). The identified component returned an error from 
             the ProcessInput method. The error is specific to the component, 
             but the error is fatal and will cause the Data Flow task to 
             stop running.  There may be error messages posted before this 
             with more information about the failure.  
End Error  

有什么想法吗?

不使用数据转换转换,而是使用派生列转换。创建一个带有内联 IF 的新布尔列,这样如果输入值为 "True",它输出 1,否则输出 0。然后在目标中使用新列。