0

我创建了一个名为test2如下的表SQL Server 2008 R2

编号 || 用户名 || 时间

tinyint 唯一标识符时间(7)

我创建了一个.csv与以下内容相同的文件,其中包含一行

编号 || 用户名 || 时间(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 单字节无符号整数

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

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

谁能告诉我我在这做错了什么?有没有办法解决这个错误?

提前致谢

4

1 回答 1

1

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

于 2012-06-06T05:38:00.163 回答