Certain rules and guidelines apply when you override a lookup query.
Consider the following guidelines when you override the lookup SQL query:
You can override the lookup SQL query for relational lookups.
Add a source lookup filter to filter the rows that are added to the lookup cache. This ensures that the Integration Service inserts rows in the dynamic cache and target table that match the WHERE clause.
If multiple Lookup transformations share a lookup cache, use the same lookup SQL override for each Lookup transformation.
If a table name or column name in the lookup query contains a reserved word, enclose the reserved word in quotes.
To override the lookup query for an uncached lookup, choose to return any value when the Integration Service finds multiple matches.
You cannot add or delete any columns from the default SQL statement.
The Developer tool does not validate the syntax of the SQL query. If the SQL override in an unconnected lookup query is not valid, the mapping fails.