variables, filters, Pre- and PostScripts and so on

Introduction

Configure an existing import package item: set its row filter and field mappings, define any required variables or scripts, and review the applicable loading options. The example filters customers by country. Save and reopen the item to check the stored configuration before running its package.

Applicability

Use this procedure after an import has been created and its behavior must be adjusted beyond the initial source, target schema, table, and package selection.

Prerequisites

  • Create the import through the Import Wizard or DWH Wizard.
  • Identify the import package item to edit.
  • Prepare the required filter expression, package variables, field mappings, and scripts.
  • Review scripts outside the production workflow before saving them.

Steps

Open the import and set its filter

  1. Open ETL.

    The ETL ribbon provides access to import tools.
    The ETL ribbon provides access to import tools
  2. Choose Imports.

    The Imports command on the ETL ribbon.
    The Imports command on the ETL ribbon
  3. Locate and open the import package item to edit.

    The selected import in the Imports list.
    The selected import in the Imports list
  4. Enter or update the Description.

  5. Enter the required expression in Filter. The example [Country] = 'Germany' limits the import by the Country value. Check the field name and comparison value against the Source, and validate the expression against the intended rows.

    The import Filter field contains the example expression [Country] = 'Germany'.
    The import Filter field contains the example expression [Country] = 'Germany'

Review field mappings and variables

  1. On the Main tab, correct any required mapping between Source Name and Target Name.

    ColumnExplanation
    Source NameThe Source column selected for the mapping.
    Target NameThe import-table column receiving the Source value.
    DescriptionOptional explanation of the mapping.
    SSIS StatementOptional package statement for the mapped field.
  2. In Variables, add or update the variable name, type, description, expression, and initial value.

    ColumnExplanation
    VariableName available to the generated package.
    TypeVariable data type: String, Integer or Boolean.
    DescriptionOptional explanation of the variable’s purpose.
    ExpressionOptional expression assigned to the variable.
    Initial valueInitial value assigned to the variable.

Configure scripts before and after the import

  1. Open the Scripts tab.

  2. Enter any required PreScript and PostScript in their Original views. PreScript runs before the import package step; PostScript runs after it. Keep the statements specific to this import and validate them before package execution.

    Review Parsed to inspect the script after AnalyticsCreator resolves macros and generated expressions. Parsed is read-only; edit the Original text when a change is needed.

Review loading options and package flags

  1. Open Options and review the settings that apply to this package. Change only the options required for its loading behavior:

    SettingExplanation
    DefaultBufferMaxRowsMaximum rows in a data-flow buffer before the package uses a new buffer.
    DefaultBufferSizeBuffer size used by the generated package data flow.
    Max insert commit sizeMaximum inserted rows committed in one operation.
    Keep nullsPreserves incoming null values instead of applying target defaults.
    Keep identityKeeps incoming identity values where supported.
    Table lockRequests a table lock while inserting target rows.
    Check constraintsControls checking target constraints during the load.
    Rows per batchBatch size for writing rows to the target.
    Command timeoutTimeout for import commands. An empty value uses the repository default.
    defaultRestores the repository default for the option on that row.
  2. Review the package flags and select only those required for this import:

    SettingExplanation
    Update StatisticsUpdates table statistics as part of the import package flow.
    Use LoggingEnables logging for the import package step.
    Externally launchedMarks the owning package as launched outside the standard package run flow.
    Manually createdMarks the owning package as manually maintained.
    Use variable to store queryStores the source query in a package variable when the Connector supports this behavior.

Save and verify

  1. Choose Save after reviewing the filter, mappings, variables, scripts, and selected options. Reopen the import to check the stored settings. Saving configuration does not execute the import.

    The Save control in the import package editor.
    The Save control in the import package editor

Expected Results

  • Reopen the same import package item and compare its saved Filter, field mappings, variables, scripts, package flags and Options with the intended configuration.
  • Review Original and Parsed script views as appropriate; the saved definition does not itself establish that its expressions or scripts produced the intended data during execution.

Decisions and variations

  • Mappings, filters, variables and scripts affect the data written when the package runs. Validate expressions and statements before production execution.

Troubleshooting

  • Saved value differs: confirm the import relationship and Package, then compare the reopened item with the values entered. Review any validation message reported by Save.
  • Cannot edit a script: use Original; Parsed is read-only.
  • Unexpected filter or script result in testing: compare actual Source columns/values with the expression and review Original/Parsed statements before another controlled run.