<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments on: SQL SERVER &#8211; 2008 &#8211; Introduction to Merge Statement &#8211; One Statement for INSERT, UPDATE, DELETE</title>
	<atom:link href="http://blog.sqlauthority.com/2008/08/28/sql-server-2008-introduction-to-merge-statement-one-statement-for-insert-update-delete/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.sqlauthority.com/2008/08/28/sql-server-2008-introduction-to-merge-statement-one-statement-for-insert-update-delete/</link>
	<description>Personal Notes of Pinal Dave</description>
	<lastBuildDate>Mon, 13 Feb 2012 15:11:24 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
	<item>
		<title>By: Aravind</title>
		<link>http://blog.sqlauthority.com/2008/08/28/sql-server-2008-introduction-to-merge-statement-one-statement-for-insert-update-delete/#comment-243446</link>
		<dc:creator><![CDATA[Aravind]]></dc:creator>
		<pubDate>Wed, 25 Jan 2012 12:28:14 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=881#comment-243446</guid>
		<description><![CDATA[Hi sir,

Delete Duplicates And Resolve Foreign Key References using merge?
If possible for set multiple source tables or target tables?please send examples..]]></description>
		<content:encoded><![CDATA[<p>Hi sir,</p>
<p>Delete Duplicates And Resolve Foreign Key References using merge?<br />
If possible for set multiple source tables or target tables?please send examples..</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: SQL SERVER &#8211; MERGE or INSERT, UPDATE, DELETE &#8211; Quiz &#8211; Puzzle &#8211; 19 of 31 &#171; SQL Server Journey with SQL Authority</title>
		<link>http://blog.sqlauthority.com/2008/08/28/sql-server-2008-introduction-to-merge-statement-one-statement-for-insert-update-delete/#comment-241046</link>
		<dc:creator><![CDATA[SQL SERVER &#8211; MERGE or INSERT, UPDATE, DELETE &#8211; Quiz &#8211; Puzzle &#8211; 19 of 31 &#171; SQL Server Journey with SQL Authority]]></dc:creator>
		<pubDate>Fri, 20 Jan 2012 01:30:59 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=881#comment-241046</guid>
		<description><![CDATA[[...] Answers ISBN: 1466405643 Page#112 Merge Operations – Insert, Update, Delete in Single Execution Introduction to Merge Statement – One Statement for INSERT, UPDATE, DELETE Explanation SQL SERVER Merge [...]]]></description>
		<content:encoded><![CDATA[<p>[...] Answers ISBN: 1466405643 Page#112 Merge Operations – Insert, Update, Delete in Single Execution Introduction to Merge Statement – One Statement for INSERT, UPDATE, DELETE Explanation SQL SERVER Merge [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: smita</title>
		<link>http://blog.sqlauthority.com/2008/08/28/sql-server-2008-introduction-to-merge-statement-one-statement-for-insert-update-delete/#comment-235231</link>
		<dc:creator><![CDATA[smita]]></dc:creator>
		<pubDate>Wed, 11 Jan 2012 11:03:05 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=881#comment-235231</guid>
		<description><![CDATA[whenevr i try merge, it generate error near &#039;as&#039; keyword]]></description>
		<content:encoded><![CDATA[<p>whenevr i try merge, it generate error near &#8216;as&#8217; keyword</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: madhavforuv Mishra</title>
		<link>http://blog.sqlauthority.com/2008/08/28/sql-server-2008-introduction-to-merge-statement-one-statement-for-insert-update-delete/#comment-231783</link>
		<dc:creator><![CDATA[madhavforuv Mishra]]></dc:creator>
		<pubDate>Thu, 05 Jan 2012 10:35:15 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=881#comment-231783</guid>
		<description><![CDATA[Nice Article]]></description>
		<content:encoded><![CDATA[<p>Nice Article</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Manoj Kopardekar</title>
		<link>http://blog.sqlauthority.com/2008/08/28/sql-server-2008-introduction-to-merge-statement-one-statement-for-insert-update-delete/#comment-220090</link>
		<dc:creator><![CDATA[Manoj Kopardekar]]></dc:creator>
		<pubDate>Sat, 17 Dec 2011 16:25:32 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=881#comment-220090</guid>
		<description><![CDATA[Sir table1 is my base table i want to reverse your query i am Trying

MERGE table1 AS m
USING (SELECT ServiceAreaCode,PhoneNumbers,Preferences,Opstype,PhoneType FROM table2) AS m1
ON m1.PhoneNumbers = m.PhoneNumbers
WHEN MATCHED AND m.Opstype = &#039;&quot;a&quot;&#039; THEN DELETE;
 
but it give errore
Msg 547, Level 16, State 0, Line 1
The MERGE statement conflicted with the REFERENCE constraint &quot;FK__manoj2__PhoneNum__1273C1CD&quot;. The conflict occurred in database &quot;test&quot;, table &quot;dbo.manoj1&quot;, column &#039;PhoneNumbers&#039;.
The statement has been terminated.

Please Help me]]></description>
		<content:encoded><![CDATA[<p>Sir table1 is my base table i want to reverse your query i am Trying</p>
<p>MERGE table1 AS m<br />
USING (SELECT ServiceAreaCode,PhoneNumbers,Preferences,Opstype,PhoneType FROM table2) AS m1<br />
ON m1.PhoneNumbers = m.PhoneNumbers<br />
WHEN MATCHED AND m.Opstype = &#8216;&#8221;a&#8221;&#8216; THEN DELETE;</p>
<p>but it give errore<br />
Msg 547, Level 16, State 0, Line 1<br />
The MERGE statement conflicted with the REFERENCE constraint &#8220;FK__manoj2__PhoneNum__1273C1CD&#8221;. The conflict occurred in database &#8220;test&#8221;, table &#8220;dbo.manoj1&#8243;, column &#8216;PhoneNumbers&#8217;.<br />
The statement has been terminated.</p>
<p>Please Help me</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kumar</title>
		<link>http://blog.sqlauthority.com/2008/08/28/sql-server-2008-introduction-to-merge-statement-one-statement-for-insert-update-delete/#comment-209470</link>
		<dc:creator><![CDATA[Kumar]]></dc:creator>
		<pubDate>Fri, 02 Dec 2011 16:46:19 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=881#comment-209470</guid>
		<description><![CDATA[getting below error even i am updating single column  that too unique records

  Msg 8672, Level 16, State 1, Procedure R_verificationData_BatchJobs, Line 5
The MERGE statement attempted to UPDATE or DELETE the same row more than once. This happens when a target row matches more than one source row. A MERGE statement cannot UPDATE/DELETE the same row of the target table multiple times. Refine the ON clause to ensure a target row matches at most one source row, or use the GROUP BY clause to group the source rows.]]></description>
		<content:encoded><![CDATA[<p>getting below error even i am updating single column  that too unique records</p>
<p>  Msg 8672, Level 16, State 1, Procedure R_verificationData_BatchJobs, Line 5<br />
The MERGE statement attempted to UPDATE or DELETE the same row more than once. This happens when a target row matches more than one source row. A MERGE statement cannot UPDATE/DELETE the same row of the target table multiple times. Refine the ON clause to ensure a target row matches at most one source row, or use the GROUP BY clause to group the source rows.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Vino</title>
		<link>http://blog.sqlauthority.com/2008/08/28/sql-server-2008-introduction-to-merge-statement-one-statement-for-insert-update-delete/#comment-201115</link>
		<dc:creator><![CDATA[Vino]]></dc:creator>
		<pubDate>Mon, 21 Nov 2011 09:51:39 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=881#comment-201115</guid>
		<description><![CDATA[This article is more useful for me.your example queries are very simple and more useful for all :)]]></description>
		<content:encoded><![CDATA[<p>This article is more useful for me.your example queries are very simple and more useful for all :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rohit</title>
		<link>http://blog.sqlauthority.com/2008/08/28/sql-server-2008-introduction-to-merge-statement-one-statement-for-insert-update-delete/#comment-177154</link>
		<dc:creator><![CDATA[Rohit]]></dc:creator>
		<pubDate>Mon, 10 Oct 2011 12:42:54 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=881#comment-177154</guid>
		<description><![CDATA[hi,
anyone tell me how can I update target table using Merge if conditional field has more then one record]]></description>
		<content:encoded><![CDATA[<p>hi,<br />
anyone tell me how can I update target table using Merge if conditional field has more then one record</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ashok</title>
		<link>http://blog.sqlauthority.com/2008/08/28/sql-server-2008-introduction-to-merge-statement-one-statement-for-insert-update-delete/#comment-173436</link>
		<dc:creator><![CDATA[ashok]]></dc:creator>
		<pubDate>Fri, 30 Sep 2011 05:58:45 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=881#comment-173436</guid>
		<description><![CDATA[I was excited to use this feature and replace this wiht my legacy insert/update statment i was writting for SSIS package to sync my data however the exececution plan show that it is not performance effective and it was using 87% of the time comparet to my normal insert/update. has any one else tested the performance of the query.]]></description>
		<content:encoded><![CDATA[<p>I was excited to use this feature and replace this wiht my legacy insert/update statment i was writting for SSIS package to sync my data however the exececution plan show that it is not performance effective and it was using 87% of the time comparet to my normal insert/update. has any one else tested the performance of the query.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: sanjay</title>
		<link>http://blog.sqlauthority.com/2008/08/28/sql-server-2008-introduction-to-merge-statement-one-statement-for-insert-update-delete/#comment-170910</link>
		<dc:creator><![CDATA[sanjay]]></dc:creator>
		<pubDate>Fri, 23 Sep 2011 13:39:50 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=881#comment-170910</guid>
		<description><![CDATA[How can i implement multiple Update In Merge Statement]]></description>
		<content:encoded><![CDATA[<p>How can i implement multiple Update In Merge Statement</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Shyamaprasad Sarkar</title>
		<link>http://blog.sqlauthority.com/2008/08/28/sql-server-2008-introduction-to-merge-statement-one-statement-for-insert-update-delete/#comment-169935</link>
		<dc:creator><![CDATA[Shyamaprasad Sarkar]]></dc:creator>
		<pubDate>Tue, 20 Sep 2011 11:48:34 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=881#comment-169935</guid>
		<description><![CDATA[Nice Article ...the understanding has been so clear that I dont need to go anywhere else..]]></description>
		<content:encoded><![CDATA[<p>Nice Article &#8230;the understanding has been so clear that I dont need to go anywhere else..</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Shyamaprasad Sarkar</title>
		<link>http://blog.sqlauthority.com/2008/08/28/sql-server-2008-introduction-to-merge-statement-one-statement-for-insert-update-delete/#comment-169933</link>
		<dc:creator><![CDATA[Shyamaprasad Sarkar]]></dc:creator>
		<pubDate>Tue, 20 Sep 2011 11:46:16 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=881#comment-169933</guid>
		<description><![CDATA[Dear Sir I just checked and found that without the studentname the Merge is working fine…]]></description>
		<content:encoded><![CDATA[<p>Dear Sir I just checked and found that without the studentname the Merge is working fine…</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Shyamaprasad Sarkar</title>
		<link>http://blog.sqlauthority.com/2008/08/28/sql-server-2008-introduction-to-merge-statement-one-statement-for-insert-update-delete/#comment-169931</link>
		<dc:creator><![CDATA[Shyamaprasad Sarkar]]></dc:creator>
		<pubDate>Tue, 20 Sep 2011 11:45:03 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=881#comment-169931</guid>
		<description><![CDATA[Dear Sir I just checked and found that studentname the Merge is working fine...]]></description>
		<content:encoded><![CDATA[<p>Dear Sir I just checked and found that studentname the Merge is working fine&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Amit Uday</title>
		<link>http://blog.sqlauthority.com/2008/08/28/sql-server-2008-introduction-to-merge-statement-one-statement-for-insert-update-delete/#comment-167683</link>
		<dc:creator><![CDATA[Amit Uday]]></dc:creator>
		<pubDate>Tue, 13 Sep 2011 05:03:29 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=881#comment-167683</guid>
		<description><![CDATA[Hi,

I have 2 tables which has only one column and contains mobile numbers. I want to combine both the tables and want to make 1 table and want to remove duplicate entries after that. Pls suggest the easiest way to perform the same.I am using SSMS 2008 version.

Regards,
Amit.]]></description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>I have 2 tables which has only one column and contains mobile numbers. I want to combine both the tables and want to make 1 table and want to remove duplicate entries after that. Pls suggest the easiest way to perform the same.I am using SSMS 2008 version.</p>
<p>Regards,<br />
Amit.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: chandra</title>
		<link>http://blog.sqlauthority.com/2008/08/28/sql-server-2008-introduction-to-merge-statement-one-statement-for-insert-update-delete/#comment-165976</link>
		<dc:creator><![CDATA[chandra]]></dc:creator>
		<pubDate>Tue, 06 Sep 2011 13:00:24 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=881#comment-165976</guid>
		<description><![CDATA[Can we have multiple source tables?
ex:

merge targettable t
using (select s1.col1, s2.col2 from source1 s1 join source2 s2 
on s1.col3 = s2.col3 ) sourcetable s3
when matched 
then update set t.col1 = s3.col1,
t.col2 = s3.col2 ;

instead above query if write like 

merge targettable t
using 
source1 s1 
join source2 s2 
on s1.col3 = s2.col3
when matched 
then update set t.col1 = s1.col1,
t.col2 = s2.col2 ;]]></description>
		<content:encoded><![CDATA[<p>Can we have multiple source tables?<br />
ex:</p>
<p>merge targettable t<br />
using (select s1.col1, s2.col2 from source1 s1 join source2 s2<br />
on s1.col3 = s2.col3 ) sourcetable s3<br />
when matched<br />
then update set t.col1 = s3.col1,<br />
t.col2 = s3.col2 ;</p>
<p>instead above query if write like </p>
<p>merge targettable t<br />
using<br />
source1 s1<br />
join source2 s2<br />
on s1.col3 = s2.col3<br />
when matched<br />
then update set t.col1 = s1.col1,<br />
t.col2 = s2.col2 ;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Vijay Konda</title>
		<link>http://blog.sqlauthority.com/2008/08/28/sql-server-2008-introduction-to-merge-statement-one-statement-for-insert-update-delete/#comment-164882</link>
		<dc:creator><![CDATA[Vijay Konda]]></dc:creator>
		<pubDate>Fri, 02 Sep 2011 19:32:39 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=881#comment-164882</guid>
		<description><![CDATA[This is perfect this helped me in understanding what a merge statement is]]></description>
		<content:encoded><![CDATA[<p>This is perfect this helped me in understanding what a merge statement is</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: s gandhi</title>
		<link>http://blog.sqlauthority.com/2008/08/28/sql-server-2008-introduction-to-merge-statement-one-statement-for-insert-update-delete/#comment-163624</link>
		<dc:creator><![CDATA[s gandhi]]></dc:creator>
		<pubDate>Tue, 30 Aug 2011 13:30:07 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=881#comment-163624</guid>
		<description><![CDATA[Nice article !! thanks]]></description>
		<content:encoded><![CDATA[<p>Nice article !! thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: SANTOSH</title>
		<link>http://blog.sqlauthority.com/2008/08/28/sql-server-2008-introduction-to-merge-statement-one-statement-for-insert-update-delete/#comment-163569</link>
		<dc:creator><![CDATA[SANTOSH]]></dc:creator>
		<pubDate>Tue, 30 Aug 2011 09:54:48 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=881#comment-163569</guid>
		<description><![CDATA[CaN WE MERGE 2 DATABASES I\?]]></description>
		<content:encoded><![CDATA[<p>CaN WE MERGE 2 DATABASES I\?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: SQL SERVER – Interview Questions and Answers – Frequently Asked Questions – Day 15 of 31 Journey to SQLAuthority</title>
		<link>http://blog.sqlauthority.com/2008/08/28/sql-server-2008-introduction-to-merge-statement-one-statement-for-insert-update-delete/#comment-148375</link>
		<dc:creator><![CDATA[SQL SERVER – Interview Questions and Answers – Frequently Asked Questions – Day 15 of 31 Journey to SQLAuthority]]></dc:creator>
		<pubDate>Fri, 15 Jul 2011 01:31:31 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=881#comment-148375</guid>
		<description><![CDATA[[...] MERGE is a new feature that provides an efficient way to perform multiple DML operations. In previous versions of SQL Server, we had to write separate statements to INSERT, UPDATE, or DELETE data based on certain conditions, but now, using MERGE statement, we can include the logic of such data modifications in one statement that even checks when the data is matched, then just update it, and when unmatched, insert it. One of the most important advantages of MERGE statement is all the data is read and processed only once. (Read more here) [...]]]></description>
		<content:encoded><![CDATA[<p>[...] MERGE is a new feature that provides an efficient way to perform multiple DML operations. In previous versions of SQL Server, we had to write separate statements to INSERT, UPDATE, or DELETE data based on certain conditions, but now, using MERGE statement, we can include the logic of such data modifications in one statement that even checks when the data is matched, then just update it, and when unmatched, insert it. One of the most important advantages of MERGE statement is all the data is read and processed only once. (Read more here) [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: srini</title>
		<link>http://blog.sqlauthority.com/2008/08/28/sql-server-2008-introduction-to-merge-statement-one-statement-for-insert-update-delete/#comment-147965</link>
		<dc:creator><![CDATA[srini]]></dc:creator>
		<pubDate>Wed, 13 Jul 2011 11:04:39 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=881#comment-147965</guid>
		<description><![CDATA[hi nice article pinal, easy to understand ,clarly, what a man great]]></description>
		<content:encoded><![CDATA[<p>hi nice article pinal, easy to understand ,clarly, what a man great</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: srini</title>
		<link>http://blog.sqlauthority.com/2008/08/28/sql-server-2008-introduction-to-merge-statement-one-statement-for-insert-update-delete/#comment-147964</link>
		<dc:creator><![CDATA[srini]]></dc:creator>
		<pubDate>Wed, 13 Jul 2011 11:03:09 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=881#comment-147964</guid>
		<description><![CDATA[Great Article]]></description>
		<content:encoded><![CDATA[<p>Great Article</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Pravin Patil</title>
		<link>http://blog.sqlauthority.com/2008/08/28/sql-server-2008-introduction-to-merge-statement-one-statement-for-insert-update-delete/#comment-144142</link>
		<dc:creator><![CDATA[Pravin Patil]]></dc:creator>
		<pubDate>Mon, 27 Jun 2011 08:44:12 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=881#comment-144142</guid>
		<description><![CDATA[Very very good article Pinal.
I always read your articles.]]></description>
		<content:encoded><![CDATA[<p>Very very good article Pinal.<br />
I always read your articles.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dilip Mevada</title>
		<link>http://blog.sqlauthority.com/2008/08/28/sql-server-2008-introduction-to-merge-statement-one-statement-for-insert-update-delete/#comment-137558</link>
		<dc:creator><![CDATA[Dilip Mevada]]></dc:creator>
		<pubDate>Mon, 30 May 2011 08:26:06 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=881#comment-137558</guid>
		<description><![CDATA[Very nice article pinal.]]></description>
		<content:encoded><![CDATA[<p>Very nice article pinal.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: John Jiménez</title>
		<link>http://blog.sqlauthority.com/2008/08/28/sql-server-2008-introduction-to-merge-statement-one-statement-for-insert-update-delete/#comment-135580</link>
		<dc:creator><![CDATA[John Jiménez]]></dc:creator>
		<pubDate>Fri, 20 May 2011 17:44:35 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=881#comment-135580</guid>
		<description><![CDATA[Hi Pinal. 

Interesting article. Here you are &#039;the hero&#039;... 

But I expose the next situation; I need merge some tables (for example table1 and table2) for two databases (BD1 as central and BD2 as extension) that have references between them, table1 is referenced for table2. If execute merge for table1, the data that exists in the table2 of BD2, in the reference value, not will be the same value after the merge. ¿how I do to merge the data in table2, if the reference value in table1 has changed and, I need do the insert with this value in the merge for table 2? 

Example. 
Table1: Customer
  IDCustomer = 1, 
  NameCustome = JOHN.

Table2: CustomerPhone
  IDCustomerPhone = 1, 
  IdCustomer = 1, 
  NumberPhone = 1234567890

  IDCustomerPhone = 2, 
  IdCustomer = 1, 
  NumberPhone = 0987654321

For example the IDCustomer has change in the merge to 5, and this value is necesary for the merge in the table2. ¿How I do for make this, without problems?

Thanks in advance,]]></description>
		<content:encoded><![CDATA[<p>Hi Pinal. </p>
<p>Interesting article. Here you are &#8216;the hero&#8217;&#8230; </p>
<p>But I expose the next situation; I need merge some tables (for example table1 and table2) for two databases (BD1 as central and BD2 as extension) that have references between them, table1 is referenced for table2. If execute merge for table1, the data that exists in the table2 of BD2, in the reference value, not will be the same value after the merge. ¿how I do to merge the data in table2, if the reference value in table1 has changed and, I need do the insert with this value in the merge for table 2? </p>
<p>Example.<br />
Table1: Customer<br />
  IDCustomer = 1,<br />
  NameCustome = JOHN.</p>
<p>Table2: CustomerPhone<br />
  IDCustomerPhone = 1,<br />
  IdCustomer = 1,<br />
  NumberPhone = 1234567890</p>
<p>  IDCustomerPhone = 2,<br />
  IdCustomer = 1,<br />
  NumberPhone = 0987654321</p>
<p>For example the IDCustomer has change in the merge to 5, and this value is necesary for the merge in the table2. ¿How I do for make this, without problems?</p>
<p>Thanks in advance,</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nishant</title>
		<link>http://blog.sqlauthority.com/2008/08/28/sql-server-2008-introduction-to-merge-statement-one-statement-for-insert-update-delete/#comment-132649</link>
		<dc:creator><![CDATA[Nishant]]></dc:creator>
		<pubDate>Tue, 03 May 2011 09:48:53 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=881#comment-132649</guid>
		<description><![CDATA[Hi Pinal,

Thanks a lot for such a nice article.]]></description>
		<content:encoded><![CDATA[<p>Hi Pinal,</p>
<p>Thanks a lot for such a nice article.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

