January 15, 2018 at 7:14 am
IN OLEDB Source I've something like
Select ContactID, Name
FROM dbo.TableA
IN Lookup Transformation I need to pull only those ContactID's
I'm writing something like this
Select * FROM dbo.TableB
where ContactID = ? (How do I pass values of ContactID)
In SQL Query will look like
Select * FROM dbo.TableB where ContactID IN (Select COntactID FROM dbo.TableA)
How can I achive the same through lookup transformation??
January 15, 2018 at 7:35 am
wweraw25 - Monday, January 15, 2018 7:14 AMIN OLEDB Source I've something likeSelect ContactID, Name
FROM dbo.TableAIN Lookup Transformation I need to pull only those ContactID's
I'm writing something like this
Select * FROM dbo.TableB
where ContactID = ? (How do I pass values of ContactID)In SQL Query will look like
Select * FROM dbo.TableB where ContactID IN (Select COntactID FROM dbo.TableA)How can I achive the same through lookup transformation??
Easy enough.
The absence of evidence is not evidence of absence
- Martin Rees
The absence of consumable DDL, sample data and desired results is, however, evidence of the absence of my response
- Phil Parkin
January 15, 2018 at 7:49 am
Phil Parkin - Monday, January 15, 2018 7:35 AMwweraw25 - Monday, January 15, 2018 7:14 AMIN OLEDB Source I've something likeSelect ContactID, Name
FROM dbo.TableAIN Lookup Transformation I need to pull only those ContactID's
I'm writing something like this
Select * FROM dbo.TableB
where ContactID = ? (How do I pass values of ContactID)In SQL Query will look like
Select * FROM dbo.TableB where ContactID IN (Select COntactID FROM dbo.TableA)How can I achive the same through lookup transformation??
- Full cache mode
- Specify how to handle rows with no matching entries: set to 'Redirect rows to nomatch output')
- Connection: Use results of an SQL Query (Select ContactID FROM dbo.TableA)
- Columns: Create join from dbo.TableB.ContactId to ContactId in 'Available Lookup Columns'
You should be good to go. Only those rows with matching ContactIDs should be passed to the 'Match' output of the Lookup.
Thanks for the response,
Select * FROM dbo.TableB
where ContactID = ?
If I want to write something like this, how can I capture values from OLEDB Source table
My tables are on two different servers.
January 15, 2018 at 8:07 am
wweraw25 - Monday, January 15, 2018 7:49 AMPhil Parkin - Monday, January 15, 2018 7:35 AMwweraw25 - Monday, January 15, 2018 7:14 AMIN OLEDB Source I've something likeSelect ContactID, Name
FROM dbo.TableAIN Lookup Transformation I need to pull only those ContactID's
I'm writing something like this
Select * FROM dbo.TableB
where ContactID = ? (How do I pass values of ContactID)In SQL Query will look like
Select * FROM dbo.TableB where ContactID IN (Select COntactID FROM dbo.TableA)How can I achive the same through lookup transformation??
- Full cache mode
- Specify how to handle rows with no matching entries: set to 'Redirect rows to nomatch output')
- Connection: Use results of an SQL Query (Select ContactID FROM dbo.TableA)
- Columns: Create join from dbo.TableB.ContactId to ContactId in 'Available Lookup Columns'
You should be good to go. Only those rows with matching ContactIDs should be passed to the 'Match' output of the Lookup.Thanks for the response,
Select * FROM dbo.TableB
where ContactID = ?If I want to write something like this, how can I capture values from OLEDB Source table
My tables are on two different servers.
You cannot easily do that. Instead you have to select them all and then filter using the lookup, as described. You could also do it via a MERGE JOIN, but this will 99.9% certain be slower than a cached lookup.
The absence of evidence is not evidence of absence
- Martin Rees
The absence of consumable DDL, sample data and desired results is, however, evidence of the absence of my response
- Phil Parkin
January 16, 2018 at 9:14 pm
wweraw25 - Monday, January 15, 2018 7:14 AMIN OLEDB Source I've something likeSelect ContactID, Name
FROM dbo.TableAIN Lookup Transformation I need to pull only those ContactID's
I'm writing something like this
Select * FROM dbo.TableB
where ContactID = ? (How do I pass values of ContactID)In SQL Query will look like
Select * FROM dbo.TableB where ContactID IN (Select COntactID FROM dbo.TableA)How can I achive the same through lookup transformation??
Please drag an OLEDB source for Table A alone.
Use lookup to compare both Table A Contact ID & B Contact ID.
Redirect unmatched rows to some other temp table OR the way you want.
****Please note that Lookup is quite slow when you work with large inputs to compare....
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply