Merging Data Sets in similar way as VLookup

  • I want to automate my manual Vlookup using Excel to SQL/SSIS.

    Table:

    vlook

    is used with  vlook2

    The columns that are the same colour are used for Vlookup.

    Currently. I am having trouble loading data from tables with non primary/secondary keys to tables with  primary and secondary keys (tables:). Error I am getting:

    SSIS package "C:\Users\Anthony.DESKTOP-ES5HL78\source\repos\WeatherDataETL_\WeatherDataETL\WeatherDataETL\Package3.dtsx" starting.
    Information: 0x4004300A at Data Flow Task, SSIS.Pipeline: Validation phase is beginning.
    Information: 0x4004300A at Data Flow Task, SSIS.Pipeline: Validation phase is beginning.
    Warning: 0x80049304 at Data Flow Task, 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 Data Flow Task, SSIS.Pipeline: Prepare for Execute phase is beginning.
    Information: 0x40043007 at Data Flow Task, SSIS.Pipeline: Pre-Execute phase is beginning.
    Information: 0x4004300C at Data Flow Task, SSIS.Pipeline: Execute phase is beginning.
    Error: 0xC0202009 at Data Flow Task, OLE DB Destination [2]: 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: "Violation of UNIQUE KEY constraint 'UQ__IMETA_Ma__212B8E0FD71948BA'. Cannot insert duplicate key in object 'dbo.IMETA_Master_BRACS_Data_TA_BR4'. The duplicate key value is (<NULL>).".
    Error: 0xC0209029 at Data Flow Task, OLE DB Destination [2]: 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 Data Flow Task, SSIS.Pipeline: SSIS Error Code DTS_E_PROCESSINPUTFAILED. The ProcessInput method on component "OLE DB Destination" (2) failed with error code 0xC0209029 while processing input "OLE DB Destination Input" (15). 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 Data Flow Task, SSIS.Pipeline: Post Execute phase is beginning.
    Information: 0x4004300B at Data Flow Task, SSIS.Pipeline: "OLE DB Destination" wrote 9 rows.
    Information: 0x40043009 at Data Flow Task, SSIS.Pipeline: Cleanup phase is beginning.
    Task failed: Data Flow Task
    Warning: 0x80019002 at Package3: 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 "C:\Users\Anthony.DESKTOP-ES5HL78\source\repos\WeatherDataETL_\WeatherDataETL\WeatherDataETL\Package3.dtsx" finished: Failure.
    The program '[14220] DtsDebugHost.exe: DTS' has exited with code 0 (0x0).
    CREATE TABLE [dbo].[IMET](
    [Acct Type] [nvarchar](50) NULL,
    [Level 1] [nvarchar](50) NULL,
    [Level 2] [nvarchar](50) NULL,
    [Level 3] [nvarchar](50) NULL,
    [GCoA] [nvarchar](50) NULL,
    [Account Desc] [nvarchar](255) NULL,
    [EXPENSE FLAG] [nvarchar](50) NULL,
    [BRACS] [int] NULL,
    [BRACS_DESC] [nvarchar](255) NULL,
    [Loaddate] [datetime] NULL
    ) ON [PRIMARY]

    and
    CREATE TABLE [dbo].[IMETA_Master_BRACS_Data_TA_BR4](

    [ZTBR_TransactionCode] INT UNIQUE,
    [Connection#] NVARCHAR(510) NULL,
    [Scenario] NVARCHAR(510) NULL,
    [Year] INT NULL,
    [Period] NVARCHAR(510) NULL,
    [View] NVARCHAR(510) NULL,
    [BRACS Entity] NVARCHAR(510) NULL,
    [Value] NVARCHAR(510) NULL,
    [ICP] NVARCHAR(510) NULL,
    [Custom3#] NVARCHAR(510) NULL,
    [Custom4#] NVARCHAR(510) NULL,
    [Account#] NVARCHAR(510) NULL,
    [Custom1#] NVARCHAR(510) NULL,
    [Custom2#] NVARCHAR(510) NULL,
    [Signage] NVARCHAR(510) NULL,
    [Sequence] INT NULL,
    [Account Group] NVARCHAR(510) NULL,
    [Country] NVARCHAR(510) NULL,
    [Account Description] NVARCHAR(510) NULL,
    [Metric Value] NVARCHAR(510) NULL,
    [Loaddate] DATE NULL,
    [Month] DATE NULL
    ) ON [PRIMARY]

     

    nd 
    CREATE TABLE [dbo].[ZTBR_Query_Destination2](
    [ZTBR_TransactionCode] [int] IDENTITY(1,1) NOT NULL,
    [Company_Code] [nvarchar](50) NULL,
    [Posting_Period] [int] NULL,
    [Fiscal_Year] [int] NULL,
    [Profit_Center] [nvarchar](50) NULL,
    [Account_Number] [nvarchar](50) NULL,
    [Business_Process] [nvarchar](50) NULL,
    [Cost_Center] [nvarchar](50) NULL,
    [Internal_Order] [nvarchar](50) NULL,
    [Trading_Partner] [nvarchar](50) NULL,
    [Amount_in_company_code_currency] [decimal](18, 2) NULL,
    [Company_code_currency] [nvarchar](50) NULL,
    [BRACS_FA] [nvarchar](50) NULL,
    [Expense_Type] [nvarchar](50) NULL,
    [BRACS_ACCT_Key] [nvarchar](50) NULL,
    [CC_Direct] [nvarchar](50) NULL,
    [Segment_PC] [nvarchar](50) NULL,
    [CC_Master_FA] [nvarchar](50) NULL,
    PRIMARY KEY CLUSTERED

     

    What would be the best way to get this results:brecs

     

    • This topic was modified 1 year, 4 months ago by  yrstruly.
    • This topic was modified 1 year, 4 months ago by  yrstruly.
    Attachments:
    You must be logged in to view attached files.
  • Thanks for posting your issue and hopefully someone will answer soon.

    This is an automated bump to increase visibility of your question.

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply