SSIS LOOKUP TRANSFORMATIONS

SSIS (SQL Server Integration Services) Lookup Transformations are components used in data flow tasks to perform lookups on a dataset, typically to retrieve additional information from a reference table based on a matching key. Add and configure the Lookup Currency Key transformation

  1. In the SSIS Toolbox, expand Common, and then drag Lookup onto the design surface of the Data Flow tab. Place Lookup directly below the Extract Sample Currency Data source.
C:\Users\user\Desktop\bluetooth\1746222881369.jpg
  1. Select the Extract Sample Currency Data flat file source and drag its blue arrow onto the newly added Lookup transformation to connect the two components.
C:\Users\user\Desktop\bluetooth\1746222881325.jpg
  1. On the Data Flow design surface, select Lookup in the Lookup transformation, and change the name to Lookup Currency Key.
C:\Users\user\Desktop\bluetooth\1746222881283.jpg
  1. Double-click the Lookup Currency Key transformation to display the Lookup Transformation Editor.
C:\Users\user\Desktop\bluetooth\1746222881243.jpg
  1. On the General page, select Full cache.
C:\Users\user\Desktop\bluetooth\1746222881203.jpg
  1. In the Connection type area, select OLE DB connection manager.
C:\Users\user\Desktop\bluetooth\1746222881203.jpg
  1. On the Connection page, in the OLE DB connection manager dialog box, ensure that localhost.AdventureWorksDW2022 is displayed.
C:\Users\user\Desktop\bluetooth\1746222881162.jpg
  1. Select Use results of a SQL query, and then enter or paste the following SQL statement:

SQLCopy

SELECT * FROM [dbo].[DimCurrency]

WHERE [CurrencyAlternateKey]

IN (‘ARS’, ‘AUD’, ‘BRL’, ‘CAD’, ‘CNY’,

    ‘DEM’, ‘EUR’, ‘FRF’, ‘GBP’, ‘JPY’,

    ‘MXN’, ‘SAR’, ‘USD’, ‘VEB’)

Select Preview to verify the query results.

C:\Users\user\Desktop\bluetooth\1746222881120.jpg
  1. On the Columns page, in the Available Input Columns panel, drag CurrencyID to the Available Lookup Columns panel and drop it on CurrencyAlternateKey.
C:\Users\user\Desktop\bluetooth\1746222881029.jpg
  1. In the Available Lookup Columns list, select the check box to the left of CurrencyKey.
C:\Users\user\Desktop\bluetooth\1746222880987.jpg
  1. Select OK to return to the Data Flow design surface.
C:\Users\user\Desktop\bluetooth\1746222880896.jpg
  1. Right-click the Lookup Currency Key transformation and select Properties.
C:\Users\user\Desktop\bluetooth\1746222880896.jpg
  1. In the Properties window, verify that the LocaleID property is English (United States) and the DefaultCodePage property is 1252.

Add and configure the Lookup Date Key transformation

  1. In the SSIS Toolbox, drag Lookup onto the Data Flow design surface. Place this Lookup directly below the Lookup Currency Key transformation.
C:\Users\user\Desktop\bluetooth\1746222880853.jpg
  1. Select the Lookup Currency Key transformation and drag its blue arrow onto the new Lookup transformation to connect the two components.
C:\Users\user\Desktop\bluetooth\1746222880808.jpg
  1. In the Input Output Selection dialog, select Lookup Match Output in the Output list box, and then select OK.
C:\Users\user\Desktop\bluetooth\1746222880766.jpg
  1. On the Data Flow design surface, select the name Lookup in the newly added Lookup transformation and change that name to Lookup Date Key.
C:\Users\user\Desktop\bluetooth\1746222880728.jpg
  1. Double-click the Lookup Date Key transformation.
  2. On the General page, select Partial cache.
C:\Users\user\Desktop\bluetooth\1746222880689.jpg
  1. On the Connection page, in the OLEDB connection manager dialog, ensure that localhost.AdventureWorksDW2022 is displayed.
C:\Users\user\Desktop\bluetooth\1746222880599.jpg
  1. In the Use a table or view box, enter or select [dbo].[DimDate].
C:\Users\user\Desktop\bluetooth\1746222880599.jpg
  1. On the Columns page, in the Available Input Columns panel, drag CurrencyDate to the Available Lookup Columns panel and drop it on FullDateAlternateKey. If you see a message indicating a data type mismatch, change the data type of CurrencyDate to [DT_DBDATE].
C:\Users\user\Desktop\bluetooth\1746222880555.jpg
  1. In the Available Lookup Columns list, select the check box to the left of DateKey.
C:\Users\user\Desktop\bluetooth\1746222880514.jpg
  1. On the Advanced page, review the caching options.
C:\Users\user\Desktop\bluetooth\1746222880480.jpg
  1. Select OK to return to the Data Flow design surface.
C:\Users\user\Desktop\bluetooth\1746222880444.jpg
  1. Right-click the Lookup Date Key transformation and select Properties.
  2. In the Properties window, verify that the LocaleID property is English (United States) and the DefaultCodePage property is 1252.
C:\Users\user\Desktop\bluetooth\1746222880409.jpg

Leave a Reply

Your email address will not be published. Required fields are marked *