代码之家  ›  专栏  ›  技术社区  ›  giorgionasis

ssis使用新的唯一键在聚合(分组方式)后插入数据

  •  1
  • giorgionasis  · 技术社区  · 6 年前

    我有微软的Contoso数据集。我的目标是从这个数据集,这是一个平面文件,以填补我的数据库表。 更具体地说,平面文件包含三列,如下所示:

    1. 货币标签
    2. 小精灵
    3. 货币说明

    我的目标是删除重复项并在表中插入具有这些列的唯一结果 1。当前密钥 2。货币标签 三。当前名称 4。货币说明

    currencykey列是表的主键,它应该自动填充ssis上结果的新键。

    在ssis中,我创建了一个包含数据流的控制流。

    在数据流中,我有平面文件源,然后使用GROUPBY聚合 对于所有列(currencyLabel、currencyName、currencyDescription),然后我将OLEDB目标设置为表。

    目标是填充我的所有四列,目标是从聚合中增加currencykey。

    平面文件的列和前两行:

    OnlineSalesKey|SalesQuantity|SalesAmount|TotalCost|UnitCost|UnitPrice|CustomerLabel|Title|FirstName|MiddleName|LastName|BirthDate|MaritalStatus|Gender|EmailAddress|YearlyIncome|TotalChildren|NumberChildrenAtHome|Education|Occupation|HouseOwnerFlag|NumberCarsOwned|Phone|CurrencyLabel|CurrencyName|CurrencyDescription|IsWorkDay|IsHoliday|HolidayName|EuropeSeason|NorthAmericaSeason|AsiaSeason|ProductLabel|ProductName|ProductDescription|Manufacturer|BrandName|ColorName|Size|Weight|ProductCategoryLabel|ProductCategoryName|ProductCategoryDescription|StoreManager|StoreType|StoreName|StoreDescription|Status|OpenDate|CloseDate|StorePhone|StoreFax|Customer_address|store_address
    19609697|1|313.52|180.22|180.22|391.9|18157||Isabella||Hall|1953-03-06|S|F|isabella80@adventure-works.com|90000|3|2|Partial College|Professional|1|1|1 (11) 500 555-0181|001|USD|US Dollar|WorkDay|0|None|Holiday|Spring/Back to Business|Holiday|0402095|Fabrikam SLR Camera M150 Orange|Digital camera ñ SLR, 5.2 in x 2.8 in x 3.7 in, 19.2 oz|Fabrikam, Inc.|Fabrikam|Orange|3.5 x 5 x 3.3 |5.25|04|Cameras and camcorders |Cameras and camcorders |246|Online|Contoso Europe Online Store|Contoso Europe Online Store|On|2004-09-03 00:00:00||731-555-0117|731-555-0117|Bundesallee 4422|Downtown Berlin, Germany
    19609733|1|166.4|95.65|95.65|208|14866||Hailey|R|Peterson|1970-10-21|S|F|hailey14@adventure-works.com|40000|2|2|Partial College|Clerical|1|2|1 (11) 500 555-0123|001|USD|US Dollar|WorkDay|0|None|Holiday|Spring/Back to Business|Holiday|0504005|The Phone Company Smart phones 160x160 M26 Black|Smart phones 160x160, AC adapter, stylus, protective cover, installation CD-ROM, application manual|The Phone Company|The Phone Company|Black|4.5 x 3.1 x 0.6|4.5999999999999996|05|Cell phones|Cell phones|246|Online|Contoso Europe Online Store|Contoso Europe Online Store|On|2004-09-03 00:00:00||731-555-0117|731-555-0117|Pflugstr 24|Downtown Berlin, Germany
    

    你可以看到田野 001美元美元 1。货币标签 2。当前名称 三。货币说明

    我的桌子

    table

    我的数据流

    dataflow

    按组聚合

    aggregate

    OLE DB目标上的映射

    mappings

    现在我的表中似乎没有写入任何内容,此输出有错误:

    SSIS package 
    Information: 0x4004300A at Fill Currency Table, SSIS.Pipeline: 
    Validation phase is beginning.
    Information: 0x4004300A at Fill Currency Table, SSIS.Pipeline: 
    Validation phase is beginning.
    Warning: 0x80049304 at Fill Currency Table, SSIS.Pipeline: Warning: 
    Could not open global shared memory to communicate with performance 
    DLL; data flow performance counters are not available.  To resolve, run 
    this package as an administrator, or on the system's console.
    Information: 0x40043006 at Fill Currency Table, SSIS.Pipeline: Prepare 
    for Execute phase is beginning.
    Information: 0x40043007 at Fill Currency Table, SSIS.Pipeline: Pre- 
    Execute phase is beginning.
    Information: 0x402090DC at Fill Currency Table, Flat File Source [30]: 
    The processing of file "C:\Users\george\Desktop\Data_201813_10M.txt" 
    has started.
    Information: 0x4004300C at Fill Currency Table, SSIS.Pipeline: Execute 
    phase is beginning.
    Information: 0x402090DE at Fill Currency Table, Flat File Source [30]: 
    The total number of data rows processed for file 
    "C:\Users\george\Desktop\Data_201813_10M.txt" is 10000001.
    Error: 0xC0202009 at Fill Currency Table, OLE DB Destination [102]: 
    SSIS Error Code DTS_E_OLEDBERROR.  An OLE DB error has occurred. Error 
    code: 0x80004005.
    An OLE DB record is available.  Source: "Microsoft SQL Server Native 
    Client 11.0"  Hresult: 0x80004005  Description: "The statement has been 
    terminated.".
    An OLE DB record is available.  Source: "Microsoft SQL Server Native 
    Client 11.0"  Hresult: 0x80004005  Description: "Cannot insert the 
    value NULL into column 'CurrencyKey', table 
    'DataWarehouse.dbo.DimCurrency'; column does not allow nulls. INSERT 
    fails.".
    Error: 0xC0209029 at Fill Currency Table, OLE DB Destination [102]: 
    SSIS Error Code DTS_E_INDUCEDTRANSFORMFAILUREONERROR.  The "OLE DB 
    Destination.Inputs[OLE DB Destination Input]" failed because error code 
    0xC020907B occurred, and the error row disposition on "OLE DB 
    Destination.Inputs[OLE DB Destination Input]" 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.
    Error: 0xC0047022 at Fill Currency Table, SSIS.Pipeline: SSIS Error 
    Code DTS_E_PROCESSINPUTFAILED.  The ProcessInput method on component 
    "OLE DB Destination" (102) failed with error code 0xC0209029 while 
     processing input "OLE DB Destination Input" (115). 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.
    Information: 0x40043008 at Fill Currency Table, SSIS.Pipeline: Post 
    Execute phase is beginning.
    Information: 0x402090DD at Fill Currency Table, Flat File Source [30]: 
    The processing of file "C:\Users\george\Desktop\Data_201813_10M.txt" 
    has ended.
    Information: 0x4004300B at Fill Currency Table, SSIS.Pipeline: "OLE DB 
    Destination" wrote 1 rows.
    Information: 0x40043009 at Fill Currency Table, SSIS.Pipeline: Cleanup 
    phase is beginning.
    Task failed: Fill Currency Table
    Warning: 0x80019002 at DataWarehouse2018: SSIS Warning Code 
    DTS_W_MAXIMUMERRORCOUNTREACHED.  The Execution method succeeded, but 
    the number of errors raised (3) reached the maximum allowed (1); 
    resulting in failure. This occurs when the number of errors reaches the 
    number specified in MaximumErrorCount. Change the MaximumErrorCount or 
    fix the errors.
    SSIS package 
    

    有什么想法吗?

    谢谢你

    0 回复  |  直到 6 年前