|
|
|
Old Hand
      
Group: General Forum Members
Last Login: Monday, May 13, 2013 2:53 PM
Points: 375,
Visits: 947
|
|
|
|
|
|
SSC-Enthusiastic
      
Group: General Forum Members
Last Login: Tuesday, May 07, 2013 3:28 AM
Points: 115,
Visits: 719
|
|
| As you're now using a staging table, you could do all three ADD/DELETE/UPDATE operations at once with an SQL MERGE. Are you going to cover that in the next part of the series?
|
|
|
|
|
SSC Rookie
      
Group: General Forum Members
Last Login: Thursday, April 18, 2013 11:56 AM
Points: 36,
Visits: 184
|
|
Delete src From Person.Contact src Join StageDeletes stage On stage.Email = src.EmailAddress
I think it should be deleted from dbo.Contact
|
|
|
|
|
Grasshopper
      
Group: General Forum Members
Last Login: Monday, April 29, 2013 4:00 AM
Points: 12,
Visits: 284
|
|
David Data (11/4/2011) As you're now using a staging table, you could do all three ADD/DELETE/UPDATE operations at once with an SQL MERGE. Are you going to cover that in the next part of the series?
^^^ THIS ^^^, yes please! I believe the MERGE function still must be contained within a script task / execute T-SQL task (no SSIS component built for it...yet...) but its so powerful its worth the extra overhead :)
Peace.
- Savage
|
|
|
|
|
Old Hand
      
Group: General Forum Members
Last Login: Monday, May 13, 2013 2:53 PM
Points: 375,
Visits: 947
|
|
Hi David,
You are correct, but I do not plan to cover the Merge statement in this series.
Andy
Andy Leonard CSO, Linchpin People Follow me on Twitter: @AndyLeonard
|
|
|
|
|
Old Hand
      
Group: General Forum Members
Last Login: Monday, May 13, 2013 2:53 PM
Points: 375,
Visits: 947
|
|
Hi Erin,
You are correct - my intent was to delete the rows from the Destination table (dbo.Contact), not the source (Person.Contact). Good catch and my bad!
Andy
Andy Leonard CSO, Linchpin People Follow me on Twitter: @AndyLeonard
|
|
|
|
|
SSC Rookie
      
Group: General Forum Members
Last Login: Friday, December 21, 2012 6:44 AM
Points: 26,
Visits: 133
|
|
| I recently was surprised to find importing a large number of wide rows it was faster to use a SSIS merge of two sorted inputs with a conditional split rather than a lookup diverting no matches to a no match connection. Have you seen a general rule when it is optimal to use the merge rather than a lookup?
|
|
|
|
|
Valued Member
      
Group: General Forum Members
Last Login: Friday, May 03, 2013 8:08 AM
Points: 66,
Visits: 675
|
|
The final test query should also be
Use AdventureWorks go Select Count(*) As RecCount From dbo.Contact Where FirstName = 'Andy' And LastName = 'Leonard'
If you run the query before executing the package you get a count of 1. After executing the package the count is 0.
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Monday, April 16, 2012 1:27 AM
Points: 7,
Visits: 36
|
|
Hi Davide,
How can one use the three ADD/DELETE/UPDATE operations at once with SQL MERGE? I would really like to have a clue of how it works.
Thanks
|
|
|
|
|
SSC Rookie
      
Group: General Forum Members
Last Login: Friday, December 21, 2012 6:44 AM
Points: 26,
Visits: 133
|
|
SQL 2008 BOL "ms-help://MS.SQLCC.v10/MS.SQLSVR.v10.en/s10de_1devconc/html/952595a6-cf1d-4ff5-8927-66f9090cf79d.htm". MS finally did something nice. It has it's limitations and place but doesn't everything. I use it quite a bit, but would really like to see it added to SSIS. Enjoy
|
|
|
|