SQL导入向导无法映射tinyint

时间:2012-02-28 12:16:41

标签: sql-server-2008 ssis sql-import-wizard

我在test2

中创建了一个名为SQL Server 2008 R2的表,如下所示

id || userid ||时间

tinyint uniqueidentifier time(7)

我创建了一个.csv文件,其内容如下,包含一行

id || userid ||时间(7)

1 b64d51a8-852f-40ea-ab4c-080df747214b 00:00:00

现在,我使用SQL导入向导将此行插入到我的数据库表中。

在选择以下映射时(见下文),我收到此错误:

  Executing (Error)
  Messages
  Error 0xc02020a1: Data Flow Task 1: Data conversion failed. The data conversion for column  "Column 0" returned status value 2 and status text "The value could not be converted because of a potential loss of data.".
 (SQL Server Import and Export Wizard)

  Error 0xc0209029: Data Flow Task 1: SSIS Error Code DTS_E_INDUCEDTRANSFORMFAILUREONERROR.  
  The "output column "Column 0" (10)" failed because error code 0xC0209084 occurred, and the error row       disposition on "output column "Column 0" (10)" 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.
  (SQL Server Import and Export Wizard)

  Error 0xc0202092: Data Flow Task 1: An error occurred while processing file    
  "C:\Users\parth\Documents\test2.csv" on data row 1.
  (SQL Server Import and Export Wizard)

   Error 0xc0047038: Data Flow Task 1: SSIS Error Code DTS_E_PRIMEOUTPUTFAILED.  
   The PrimeOutput method on component "Source - test2_csv" (1) returned error code 0xC0202092.  
   The component returned a failure code when the pipeline engine called PrimeOutput(). 
   The meaning of the failure code is defined by the component, but the error is fatal and the
   pipeline stopped executing. 
   There may be error messages posted before this with more information about the failure.
   (SQL Server Import and Export Wizard)

映射:

id(tinyint) - > SSIS单字节unsigned int

userid(uniqueidentifier) - > SSIS唯一标识符

时间(7)--->精确的SSIS数据库时间

任何人都能告诉我这件事我做错了吗?有没有办法解决这个错误?

提前致谢

1 个答案:

答案 0 :(得分:1)

使用单字节无符号整数作为源数据类型映射到tinyint目标。 tinyint使用1个字节的存储空间,其值范围为0到255,因此它是无符号的。