Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Dynamic SQL Merge Expand / Collapse
Author
Message
Posted Tuesday, April 07, 2009 12:03 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Friday, May 10, 2013 10:24 AM
Points: 9, Visits: 218
Comments posted to this topic are about the item Dynamic SQL Merge
Post #691709
Posted Tuesday, April 07, 2009 5:53 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Tuesday, May 07, 2013 7:34 AM
Points: 1, Visits: 16
What about using of tablediff utility?
Post #691870
Posted Tuesday, April 07, 2009 9:34 AM


Right there with Babe

Right there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with Babe

Group: General Forum Members
Last Login: Thursday, February 14, 2013 12:01 PM
Points: 743, Visits: 900
I think this procedure is impressively well done.

With that said, It does seem to be a bit of a solution looking for a problem. Writing the merge statement directly is not at all challenging and it seems easier to simply do that then learn the nuances of this procedure, especially since writing it directly permits it to be made more nuanced if so desired.


---
Timothy A Wiseman
SQL Blog: http://timothyawiseman.wordpress.com/
Post #692189
Posted Tuesday, April 07, 2009 9:39 AM


Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: 2 days ago @ 12:43 PM
Points: 1,148, Visits: 3,148
Nice Glen :)

I just posted a similar SP - just went about a little different.....

http://www.sqlservercentral.com/scripts/SQL+2008/66507/


Tommy

Post #692199
Posted Wednesday, April 08, 2009 12:56 AM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Sunday, May 10, 2009 9:29 PM
Points: 29, Visits: 6
Thank you so much for posting this!

Post #692791
Posted Friday, March 15, 2013 7:43 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Tuesday, April 09, 2013 7:02 AM
Points: 1, Visits: 2
Excellent work. Never mind the comment about this being a solution looking for a problem, this proc was exactly what I needed. We have lots of different reference data tables what I want to keep "relatively" in sync and this gives me 99% of what I need. The other 1% I can tweak the proc to make happen.

One thing, in your example 2, merging from a linked server, I believe you need to change the @srcType value sent in to 'LINK' from 'SQL'. That's what I needed to do in order to pull from the linked server. It wouldn't work otherwise.

Post #1431536
Posted Friday, March 15, 2013 8:15 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Friday, May 10, 2013 10:24 AM
Points: 9, Visits: 218
Thank you very much for your kind feedback. Your comments are correct regarding the "link". The actual usage for this was originally to an AS400 linked server.

As so often happens when you provide a tool which makes coding easier, I've now had to re-train folks so that they don't over-use the MERGE statement:)
Post #1431559
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse