![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
#3
| |||
| |||
|
|
I have: 1. A delimited text file with 2 columns (ID, Value) 2. DB table (ID, Value) I would like to create a Data Flow Task that: 1. Extracts the data from the text file 2. Compares Value from the text file using ID to bind with the DB table 3. UPDATES the non-matching (or changed) Values into the DB table I would like to achieve all of this WITHOUT creating temporary staging tables. I was under the impression that SSIS and ETL was supposed to provide the ability to cut down (or even eliminate) the need for staging tables. I feel like I am missing a major component or lacking the understanding of something fundamental in the Data Flow Task process. Any assistance to point me in the right direction would be greatly appreciated. Thanks |
#4
| |||
| |||
|
|
Hello tbmilk (AT) gmail (DOT) com, Ok so here is how I would have done it Text File source adapter Lookup transform. If the lookup is not a match in the destination table then it follows the Error output. The error output then runs to an OLEDB transform. This has the update statement. Here are some articles that will help to show what I mean Lookup Error output http://wiki.sqlis.com/default.aspx/S...rorOutput.html OLE DB trandform. You do not need to use a proc here. You can just map the input columns in your case to an update statement. http://wiki.sqlis.com/default.aspx/S...tyColumns.html Allan Mitchell www.SQLDTS.com www.SQLIS.com www.Konesans.com I have: 1. A delimited text file with 2 columns (ID, Value) 2. DB table (ID, Value) I would like to create a Data Flow Task that: 1. Extracts the data from the text file 2. Compares Value from the text file using ID to bind with the DB table 3. UPDATES the non-matching (or changed) Values into the DB table I would like to achieve all of this WITHOUT creating temporary staging tables. I was under the impression that SSIS and ETL was supposed to provide the ability to cut down (or even eliminate) the need for staging tables. I feel like I am missing a major component or lacking the understanding of something fundamental in the Data Flow Task process. Any assistance to point me in the right direction would be greatly appreciated. Thanks |
#5
| |||
| |||
|
|
Thanks for posting this...this idea definately seems like a slick way of tackling this issue. Allan Mitchell wrote: Hello tbmilk (AT) gmail (DOT) com, Ok so here is how I would have done it Text File source adapter Lookup transform. If the lookup is not a match in the destination table then it follows the Error output. The error output then runs to an OLEDB transform. This has the update statement. Here are some articles that will help to show what I mean Lookup Error output http://wiki.sqlis.com/default.aspx/S...rorOutput.html OLE DB trandform. You do not need to use a proc here. You can just map the input columns in your case to an update statement. http://wiki.sqlis.com/default.aspx/S...tyColumns.html Allan Mitchell www.SQLDTS.com www.SQLIS.com www.Konesans.com I have: 1. A delimited text file with 2 columns (ID, Value) 2. DB table (ID, Value) I would like to create a Data Flow Task that: 1. Extracts the data from the text file 2. Compares Value from the text file using ID to bind with the DB table 3. UPDATES the non-matching (or changed) Values into the DB table I would like to achieve all of this WITHOUT creating temporary staging tables. I was under the impression that SSIS and ETL was supposed to provide the ability to cut down (or even eliminate) the need for staging tables. I feel like I am missing a major component or lacking the understanding of something fundamental in the Data Flow Task process. Any assistance to point me in the right direction would be greatly appreciated. Thanks |
#6
| |||
| |||
|
|
I have implemented your suggestions and it works WAY better than my idea. I'm wondering now, if there is any way (within the Data Flow Task) to kind of do the reverse. For example: Lets say a User ID has been removed from our system and therefor it is no longer in the text file source. Is there a way I can perform a lookup that will allow me to run a DELETE OLE DB command on the DB table? In essence. If the row IS NOT in the text file, I do not want it in the DB table. I find that INSERT and UPDATE work great using your example, however, DELETE is proving problematic tbmilk (AT) gmail (DOT) com wrote: Thanks for posting this...this idea definately seems like a slick way of tackling this issue. Allan Mitchell wrote: Hello tbmilk (AT) gmail (DOT) com, Ok so here is how I would have done it Text File source adapter Lookup transform. If the lookup is not a match in the destination table then it follows the Error output. The error output then runs to an OLEDB transform. This has the update statement. Here are some articles that will help to show what I mean Lookup Error output http://wiki.sqlis.com/default.aspx/S...nsformErrorOut put.html OLE DB trandform. You do not need to use a proc here. You can just map the input columns in your case to an update statement. http://wiki.sqlis.com/default.aspx/S...andTransformat ionAndIdentityColumns.html Allan Mitchell www.SQLDTS.com www.SQLIS.com www.Konesans.com I have: 1. A delimited text file with 2 columns (ID, Value) 2. DB table (ID, Value) I would like to create a Data Flow Task that: 1. Extracts the data from the text file 2. Compares Value from the text file using ID to bind with the DB table 3. UPDATES the non-matching (or changed) Values into the DB table I would like to achieve all of this WITHOUT creating temporary staging tables. I was under the impression that SSIS and ETL was supposed to provide the ability to cut down (or even eliminate) the need for staging tables. I feel like I am missing a major component or lacking the understanding of something fundamental in the Data Flow Task process. Any assistance to point me in the right direction would be greatly appreciated. Thanks |
#7
| |||
| |||
|
|
Hello tbmilk (AT) gmail (DOT) com, OK So a lookup must be against a RDBMS and a Text File is most definitely not one of them. here is an idea. Two sources to the pipeline (Text File + OLE DB) Merge Join (LEFT OUTER JOIN) so your text file is on the left hand side (INPUT) and the OLE DB Connection is the right hand side (INPUT) Join the two inputs on the respective columns When rows come flowing through those that do not match will have a NULL associated with them. Use a Conditional split to pipe off these rows to an OLE DB transform. Allan Mitchell www.SQLDTS.com www.SQLIS.com www.Konesans.com I have implemented your suggestions and it works WAY better than my idea. I'm wondering now, if there is any way (within the Data Flow Task) to kind of do the reverse. For example: Lets say a User ID has been removed from our system and therefor it is no longer in the text file source. Is there a way I can perform a lookup that will allow me to run a DELETE OLE DB command on the DB table? In essence. If the row IS NOT in the text file, I do not want it in the DB table. I find that INSERT and UPDATE work great using your example, however, DELETE is proving problematic tbmilk (AT) gmail (DOT) com wrote: Thanks for posting this...this idea definately seems like a slick way of tackling this issue. Allan Mitchell wrote: Hello tbmilk (AT) gmail (DOT) com, Ok so here is how I would have done it Text File source adapter Lookup transform. If the lookup is not a match in the destination table then it follows the Error output. The error output then runs to an OLEDB transform. This has the update statement. Here are some articles that will help to show what I mean Lookup Error output http://wiki.sqlis.com/default.aspx/S...nsformErrorOut put.html OLE DB trandform. You do not need to use a proc here. You can just map the input columns in your case to an update statement. http://wiki.sqlis.com/default.aspx/S...andTransformat ionAndIdentityColumns.html Allan Mitchell www.SQLDTS.com www.SQLIS.com www.Konesans.com I have: 1. A delimited text file with 2 columns (ID, Value) 2. DB table (ID, Value) I would like to create a Data Flow Task that: 1. Extracts the data from the text file 2. Compares Value from the text file using ID to bind with the DB table 3. UPDATES the non-matching (or changed) Values into the DB table I would like to achieve all of this WITHOUT creating temporary staging tables. I was under the impression that SSIS and ETL was supposed to provide the ability to cut down (or even eliminate) the need for staging tables. I feel like I am missing a major component or lacking the understanding of something fundamental in the Data Flow Task process. Any assistance to point me in the right direction would be greatly appreciated. Thanks |
#8
| |||
| |||
|
|
Absolutely brilliant! Allan Mitchell wrote: Hello tbmilk (AT) gmail (DOT) com, OK So a lookup must be against a RDBMS and a Text File is most definitely not one of them. here is an idea. Two sources to the pipeline (Text File + OLE DB) Merge Join (LEFT OUTER JOIN) so your text file is on the left hand side (INPUT) and the OLE DB Connection is the right hand side (INPUT) Join the two inputs on the respective columns When rows come flowing through those that do not match will have a NULL associated with them. Use a Conditional split to pipe off these rows to an OLE DB transform. Allan Mitchell www.SQLDTS.com www.SQLIS.com www.Konesans.com I have implemented your suggestions and it works WAY better than my idea. I'm wondering now, if there is any way (within the Data Flow Task) to kind of do the reverse. For example: Lets say a User ID has been removed from our system and therefor it is no longer in the text file source. Is there a way I can perform a lookup that will allow me to run a DELETE OLE DB command on the DB table? In essence. If the row IS NOT in the text file, I do not want it in the DB table. I find that INSERT and UPDATE work great using your example, however, DELETE is proving problematic tbmilk (AT) gmail (DOT) com wrote: Thanks for posting this...this idea definately seems like a slick way of tackling this issue. Allan Mitchell wrote: Hello tbmilk (AT) gmail (DOT) com, Ok so here is how I would have done it Text File source adapter Lookup transform. If the lookup is not a match in the destination table then it follows the Error output. The error output then runs to an OLEDB transform. This has the update statement. Here are some articles that will help to show what I mean Lookup Error output http://wiki.sqlis.com/default.aspx/S...nsformErrorOut put.html OLE DB trandform. You do not need to use a proc here. You can just map the input columns in your case to an update statement. http://wiki.sqlis.com/default.aspx/S...andTransformat ionAndIdentityColumns.html Allan Mitchell www.SQLDTS.com www.SQLIS.com www.Konesans.com I have: 1. A delimited text file with 2 columns (ID, Value) 2. DB table (ID, Value) I would like to create a Data Flow Task that: 1. Extracts the data from the text file 2. Compares Value from the text file using ID to bind with the DB table 3. UPDATES the non-matching (or changed) Values into the DB table I would like to achieve all of this WITHOUT creating temporary staging tables. I was under the impression that SSIS and ETL was supposed to provide the ability to cut down (or even eliminate) the need for staging tables. I feel like I am missing a major component or lacking the understanding of something fundamental in the Data Flow Task process. Any assistance to point me in the right direction would be greatly appreciated. Thanks |
#9
| |||
| |||
|
|
Flat File: ID = 1, Value = A ID = 2, Value = C Database Table: ID = 2, Value = B ID = 3, Value = D |
|
Okay...this will be the last question for this thread :-) I currently have the ability to UPDATE and DELETE records in my OLE DB destination based on my Flat File Source. I am trying to create a OLE DB Destination that will INSERT INTO my DB table. I am trying to use the MERGE JOIN transform (ala what you said about DELETING) however it does not work. (I can't check for a <Null value because I need that value to INSERT into my table) Here is an example: Flat File: ID = 1, Value = A ID = 2, Value = C Database Table: ID = 2, Value = B ID = 3, Value = D Now... 1. The lookup is going to detect that ID = 2 Value needs to be changed to C....Done! 2. The MERGE JOIN is going to JOIN the Flat File and Table and return a <Null> for Value on ID = 3....the Condition checks for the <Null> and DELETES row......Done! 3. I need to INSERT ID = 1 into the table......HELP! tbmilk (AT) gmail (DOT) com wrote: Absolutely brilliant! Allan Mitchell wrote: Hello tbmilk (AT) gmail (DOT) com, OK So a lookup must be against a RDBMS and a Text File is most definitely not one of them. here is an idea. Two sources to the pipeline (Text File + OLE DB) Merge Join (LEFT OUTER JOIN) so your text file is on the left hand side (INPUT) and the OLE DB Connection is the right hand side (INPUT) Join the two inputs on the respective columns When rows come flowing through those that do not match will have a NULL associated with them. Use a Conditional split to pipe off these rows to an OLE DB transform. Allan Mitchell www.SQLDTS.com www.SQLIS.com www.Konesans.com I have implemented your suggestions and it works WAY better than my idea. I'm wondering now, if there is any way (within the Data Flow Task) to kind of do the reverse. For example: Lets say a User ID has been removed from our system and therefor it is no longer in the text file source. Is there a way I can perform a lookup that will allow me to run a DELETE OLE DB command on the DB table? In essence. If the row IS NOT in the text file, I do not want it in the DB table. I find that INSERT and UPDATE work great using your example, however, DELETE is proving problematic tbmilk (AT) gmail (DOT) com wrote: Thanks for posting this...this idea definately seems like a slick way of tackling this issue. Allan Mitchell wrote: Hello tbmilk (AT) gmail (DOT) com, Ok so here is how I would have done it Text File source adapter Lookup transform. If the lookup is not a match in the destination table then it follows the Error output. The error output then runs to an OLEDB transform. This has the update statement. Here are some articles that will help to show what I mean Lookup Error output http://wiki.sqlis.com/default.aspx/S...nsformErrorOut put.html OLE DB trandform. You do not need to use a proc here. You can just map the input columns in your case to an update statement. http://wiki.sqlis.com/default.aspx/S...andTransformat ionAndIdentityColumns.html Allan Mitchell www.SQLDTS.com www.SQLIS.com www.Konesans.com I have: 1. A delimited text file with 2 columns (ID, Value) 2. DB table (ID, Value) I would like to create a Data Flow Task that: 1. Extracts the data from the text file 2. Compares Value from the text file using ID to bind with the DB table 3. UPDATES the non-matching (or changed) Values into the DB table I would like to achieve all of this WITHOUT creating temporary staging tables. I was under the impression that SSIS and ETL was supposed to provide the ability to cut down (or even eliminate) the need for staging tables. I feel like I am missing a major component or lacking the understanding of something fundamental in the Data Flow Task process. Any assistance to point me in the right direction would be greatly appreciated. Thanks |
![]() |
| Thread Tools | |
| Display Modes | |
| |