|
|
|
SSC-Addicted
      
Group: General Forum Members
Last Login: Saturday, May 11, 2013 8:17 AM
Points: 460,
Visits: 2,521
|
|
|
|
|
|
SSC-Enthusiastic
      
Group: General Forum Members
Last Login: Wednesday, March 31, 2010 6:02 PM
Points: 174,
Visits: 2,075
|
|
Jacob, Wayne, Charles and other interested parties, There is the sql standard and then there is the 'relational' approach. I urge you to compare S2008 MATCH with the ideas presented here: http://beyondsql.blogspot.com/2007/06/dataphor-intelligent-views.html We should be talking about intelligient operations on 'views'. And views are something sql has...well dumbed down MATCH, conceptually, has much in common with the S2008 idea of a table parameter. I'm trying to show these concepts in a mature form now, as opposed to the MS siblings of pre-adolescence www.beyondsql.blogspot.com I hope to be presenting at the Phoenix SQL Server User Group soon. I will try to make things lively and informative 
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Friday, April 26, 2013 12:14 PM
Points: 6,
Visits: 295
|
|
Has anyone compared the performance of a MERGE statement with the "old" standard of UPDATE and INSERT? Specifically with regards to data warehouse loading.
Thanks,
jake
|
|
|
|
|
SSC-Enthusiastic
      
Group: General Forum Members
Last Login: Wednesday, March 13, 2013 10:51 PM
Points: 161,
Visits: 301
|
|
Yes, it's faster. It doesn't need to loop through the data multiple times to find out which rows exist and therefore need updating, and which ones don't and therefore need inserting.
Rob Farley LobsterPot Solutions & Adelaide SQL Server User Group Company: http://www.lobsterpot.com.au Blog: http://sqlblog.com/blogs/rob_farley
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Wednesday, January 14, 2009 3:29 PM
Points: 1,
Visits: 5
|
|
| How can I accomplish the same result albeit slower in SQL Server 2005 - not using MERGE?
|
|
|
|
|
SSC-Addicted
      
Group: General Forum Members
Last Login: Saturday, May 11, 2013 8:17 AM
Points: 460,
Visits: 2,521
|
|
In SQL Server 2005, you would need three separate DELETE, UPDATE and INSERT statements. You can find an example (look at the last example) here: http://www.sqlservercentral.com/columnists/jSebastian/2912.asp
.
|
|
|
|
|
Grasshopper
      
Group: General Forum Members
Last Login: Friday, May 10, 2013 3:12 AM
Points: 10,
Visits: 97
|
|
Hi Sebastian,
On going thru your code, i could notice that you are delete the records by ...WHEN SOURCE NOT MATCHED THEN DELETE;
i suppose that it would delete all other records which doesn't meet the on clause join condition of the merge, like orderdetails of other orders ..........
Pls. clarify me...
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Wednesday, May 15, 2013 11:03 AM
Points: 7,
Visits: 90
|
|
I was working with SQL 2008 R2 and found that to use delete when there is no match, the syntax got changed. Instead of
"WHEN SOURCE NOT MATCHED THEN DELETE;"
It is now
"WHEN NOT MATCHED BY SOURCE THEN DELETE;"
Hope you guys have noticed. But Just an FYI
|
|
|
|