<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Table Difference &#8211; Database Research &amp; Development</title>
	<atom:link href="https://www.dbrnd.com/tag/table-difference/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.dbrnd.com</link>
	<description>BIGData &#124; NoSQL &#124; MSSQL &#124; MySQL &#124; PostgreSQL</description>
	<lastBuildDate>Sun, 17 Dec 2017 18:18:55 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.0.5</generator>
	<item>
		<title>SQL Server: Easy way to get the Table Difference For Data</title>
		<link>https://www.dbrnd.com/2018/01/sql-server-easy-way-to-get-the-table-difference/</link>
		
		<dc:creator><![CDATA[Anvesh Patel]]></dc:creator>
		<pubDate>Mon, 08 Jan 2018 16:16:18 +0000</pubDate>
				<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[Anvesh Patel]]></category>
		<category><![CDATA[Compare Table]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[database research and development]]></category>
		<category><![CDATA[dbrnd]]></category>
		<category><![CDATA[SQL Query]]></category>
		<category><![CDATA[SQL Server Administrator]]></category>
		<category><![CDATA[SQL Server Error]]></category>
		<category><![CDATA[SQL Server Monitoring]]></category>
		<category><![CDATA[SQL Server Performance Tuning]]></category>
		<category><![CDATA[SQL Server Programming]]></category>
		<category><![CDATA[SQL Server Tips and Tricks]]></category>
		<category><![CDATA[Table Difference]]></category>
		<category><![CDATA[TSQL]]></category>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=6882</guid>

					<description><![CDATA[<div><img width="620" height="413" src="https://www.dbrnd.com/wp-content/uploads/2017/12/CompareTable.jpg" class="attachment-post-image size-post-image wp-post-image" alt="Compare Table In SQL Server" decoding="async" fetchpriority="high" /></div>In this post, I am sharing a script for comparing the table difference in SQL Server. For comparing or taking the difference of tables is a very common task for most of the database developers. So you guys can access the below simple demonstration on this. Create two sample tables: [crayon-6aacbe481b1b6601744217/] Insert sampel records: [crayon-6aacbe481b1ba243226209/] [&#8230;]]]></description>
										<content:encoded><![CDATA[<div><img width="620" height="413" src="https://www.dbrnd.com/wp-content/uploads/2017/12/CompareTable.jpg" class="attachment-post-image size-post-image wp-post-image" alt="Compare Table In SQL Server" decoding="async" /></div><p><a class="a2a_button_facebook" href="https://www.addtoany.com/add_to/facebook?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2018%2F01%2Fsql-server-easy-way-to-get-the-table-difference%2F&amp;linkname=SQL%20Server%3A%20Easy%20way%20to%20get%20the%20Table%20Difference%20For%20Data" title="Facebook" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_twitter" href="https://www.addtoany.com/add_to/twitter?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2018%2F01%2Fsql-server-easy-way-to-get-the-table-difference%2F&amp;linkname=SQL%20Server%3A%20Easy%20way%20to%20get%20the%20Table%20Difference%20For%20Data" title="Twitter" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_linkedin" href="https://www.addtoany.com/add_to/linkedin?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2018%2F01%2Fsql-server-easy-way-to-get-the-table-difference%2F&amp;linkname=SQL%20Server%3A%20Easy%20way%20to%20get%20the%20Table%20Difference%20For%20Data" title="LinkedIn" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_pinterest" href="https://www.addtoany.com/add_to/pinterest?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2018%2F01%2Fsql-server-easy-way-to-get-the-table-difference%2F&amp;linkname=SQL%20Server%3A%20Easy%20way%20to%20get%20the%20Table%20Difference%20For%20Data" title="Pinterest" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_reddit" href="https://www.addtoany.com/add_to/reddit?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2018%2F01%2Fsql-server-easy-way-to-get-the-table-difference%2F&amp;linkname=SQL%20Server%3A%20Easy%20way%20to%20get%20the%20Table%20Difference%20For%20Data" title="Reddit" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_pocket" href="https://www.addtoany.com/add_to/pocket?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2018%2F01%2Fsql-server-easy-way-to-get-the-table-difference%2F&amp;linkname=SQL%20Server%3A%20Easy%20way%20to%20get%20the%20Table%20Difference%20For%20Data" title="Pocket" rel="nofollow noopener" target="_blank"></a><a class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Fwww.dbrnd.com%2F2018%2F01%2Fsql-server-easy-way-to-get-the-table-difference%2F&#038;title=SQL%20Server%3A%20Easy%20way%20to%20get%20the%20Table%20Difference%20For%20Data" data-a2a-url="https://www.dbrnd.com/2018/01/sql-server-easy-way-to-get-the-table-difference/" data-a2a-title="SQL Server: Easy way to get the Table Difference For Data"></a></p><p>In this post, I am sharing a script for comparing the table difference in SQL Server. </p>
<p>For comparing or taking the difference of tables is a very common task for most of the database developers.<br />
So you guys can access the below simple demonstration on this. </p>
<p><strong>Create two sample tables:</strong></p>
<pre class="crayon-plain-tag">CREATE TABLE tbl_ABC (Rno INT, Name VARCHAR(20))
GO
CREATE TABLE tbl_XYZ (Rno INT, Name VARCHAR(20))
GO</pre> </p>
<p><strong>Insert sampel records:</strong></p>
<pre class="crayon-plain-tag">INSERT INTO tbl_ABC 
VALUES (1,'A'),(2,'B'),(3,'D'),(4,'E')
GO
INSERT INTO tbl_XYZ
VALUES (1,'A'),(2,'C'),(3,'D'),(4,'F')
GO</pre> </p>
<p><strong>Compare and Find the table differences: </strong></p>
<pre class="crayon-plain-tag">SELECT Rno, Name FROM
(
    SELECT Rno, Name FROM tbl_ABC
    UNION ALL
    SELECT Rno, Name FROM tbl_XYZ
) A
GROUP BY Rno, Name
HAVING COUNT(*) &lt;&gt; 2</pre> </p>
<p><strong>Result:</strong></p>
<pre class="crayon-plain-tag">Rno         Name
----------- ---------
2           B
2           C
4           E
4           F</pre> </p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>SQL Server: How to get the Table Column Differences?</title>
		<link>https://www.dbrnd.com/2018/01/sql-server-how-to-get-the-table-column-differences/</link>
		
		<dc:creator><![CDATA[Anvesh Patel]]></dc:creator>
		<pubDate>Mon, 01 Jan 2018 16:16:21 +0000</pubDate>
				<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[Anvesh Patel]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[database research and development]]></category>
		<category><![CDATA[dbrnd]]></category>
		<category><![CDATA[SQL Query]]></category>
		<category><![CDATA[SQL Server Administrator]]></category>
		<category><![CDATA[SQL Server Error]]></category>
		<category><![CDATA[SQL Server Monitoring]]></category>
		<category><![CDATA[SQL Server Performance Tuning]]></category>
		<category><![CDATA[SQL Server Programming]]></category>
		<category><![CDATA[SQL Server Tips and Tricks]]></category>
		<category><![CDATA[Table Column Difference]]></category>
		<category><![CDATA[TABLE COMPARE]]></category>
		<category><![CDATA[Table Difference]]></category>
		<category><![CDATA[TSQL]]></category>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=6889</guid>

					<description><![CDATA[<div><img width="679" height="453" src="https://www.dbrnd.com/wp-content/uploads/2018/01/SQLTableColumnCompare-679x453.jpg" class="attachment-post-image size-post-image wp-post-image" alt="SQL Table Column Compare" decoding="async" srcset="https://www.dbrnd.com/wp-content/uploads/2018/01/SQLTableColumnCompare-679x453.jpg 679w, https://www.dbrnd.com/wp-content/uploads/2018/01/SQLTableColumnCompare-1030x687.jpg 1030w, https://www.dbrnd.com/wp-content/uploads/2018/01/SQLTableColumnCompare-850x567.jpg 850w, https://www.dbrnd.com/wp-content/uploads/2018/01/SQLTableColumnCompare.jpg 1200w" sizes="(max-width: 679px) 100vw, 679px" /></div>In this post, I am sharing few scripts for getting the column differences of the similar table in SQL Server. If your table has a number of columns like more than 100, it is very difficult to compare the column with another same table. Mostly, we are doing this kind of comparison between production database [&#8230;]]]></description>
										<content:encoded><![CDATA[<div><img width="679" height="453" src="https://www.dbrnd.com/wp-content/uploads/2018/01/SQLTableColumnCompare-679x453.jpg" class="attachment-post-image size-post-image wp-post-image" alt="SQL Table Column Compare" decoding="async" loading="lazy" srcset="https://www.dbrnd.com/wp-content/uploads/2018/01/SQLTableColumnCompare-679x453.jpg 679w, https://www.dbrnd.com/wp-content/uploads/2018/01/SQLTableColumnCompare-1030x687.jpg 1030w, https://www.dbrnd.com/wp-content/uploads/2018/01/SQLTableColumnCompare-850x567.jpg 850w, https://www.dbrnd.com/wp-content/uploads/2018/01/SQLTableColumnCompare.jpg 1200w" sizes="auto, (max-width: 679px) 100vw, 679px" /></div><p><a class="a2a_button_facebook" href="https://www.addtoany.com/add_to/facebook?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2018%2F01%2Fsql-server-how-to-get-the-table-column-differences%2F&amp;linkname=SQL%20Server%3A%20How%20to%20get%20the%20Table%20Column%20Differences%3F" title="Facebook" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_twitter" href="https://www.addtoany.com/add_to/twitter?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2018%2F01%2Fsql-server-how-to-get-the-table-column-differences%2F&amp;linkname=SQL%20Server%3A%20How%20to%20get%20the%20Table%20Column%20Differences%3F" title="Twitter" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_linkedin" href="https://www.addtoany.com/add_to/linkedin?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2018%2F01%2Fsql-server-how-to-get-the-table-column-differences%2F&amp;linkname=SQL%20Server%3A%20How%20to%20get%20the%20Table%20Column%20Differences%3F" title="LinkedIn" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_pinterest" href="https://www.addtoany.com/add_to/pinterest?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2018%2F01%2Fsql-server-how-to-get-the-table-column-differences%2F&amp;linkname=SQL%20Server%3A%20How%20to%20get%20the%20Table%20Column%20Differences%3F" title="Pinterest" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_reddit" href="https://www.addtoany.com/add_to/reddit?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2018%2F01%2Fsql-server-how-to-get-the-table-column-differences%2F&amp;linkname=SQL%20Server%3A%20How%20to%20get%20the%20Table%20Column%20Differences%3F" title="Reddit" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_pocket" href="https://www.addtoany.com/add_to/pocket?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2018%2F01%2Fsql-server-how-to-get-the-table-column-differences%2F&amp;linkname=SQL%20Server%3A%20How%20to%20get%20the%20Table%20Column%20Differences%3F" title="Pocket" rel="nofollow noopener" target="_blank"></a><a class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Fwww.dbrnd.com%2F2018%2F01%2Fsql-server-how-to-get-the-table-column-differences%2F&#038;title=SQL%20Server%3A%20How%20to%20get%20the%20Table%20Column%20Differences%3F" data-a2a-url="https://www.dbrnd.com/2018/01/sql-server-how-to-get-the-table-column-differences/" data-a2a-title="SQL Server: How to get the Table Column Differences?"></a></p><p>In this post, I am sharing few scripts for getting the column differences of the similar table in SQL Server.</p>
<p>If your table has a number of columns like more than 100, it is very difficult to compare the column with another same table.<br />
Mostly, we are doing this kind of comparison between production database and other sprint databases.</p>
<p>You can access the below small demonstration on this:</p>
<p><strong>Create two sample tables:</strong></p><pre class="crayon-plain-tag">CREATE TABLE tbl_ABC (Rno INT, Name CHAR(20), Class INT)
GO
CREATE TABLE tbl_XYZ (Rno INT, Name VARCHAR(20))
GO</pre><p>
<strong>Find the difference of column datatype:</strong></p><pre class="crayon-plain-tag">select
	ic1.TABLE_NAME
	,ic1.COLUMN_NAME
	,ic1.DATA_TYPE
	,ic2.TABLE_NAME
	,ic2.DATA_TYPE
	,ic2.COLUMN_NAME
from INFORMATION_SCHEMA.COLUMNS as ic1
left join INFORMATION_SCHEMA.COLUMNS as ic2
on ic1.COLUMN_NAME=ic2.COLUMN_NAME
where ic1.TABLE_NAME='tbl_ABC'
and ic2.TABLE_NAME='tbl_XYZ'
and ic1.data_type &lt;&gt; ic2.DATA_TYPE</pre><p>
<strong>Result:</strong></p>
<p><img loading="lazy" decoding="async" class="alignnone size-full wp-image-6895" src="https://www.dbrnd.com/wp-content/uploads/2017/12/SQLTableCompare.png" alt="SQL Table Compare" width="669" height="57" /></p>
<p><strong>Find extra column from another similar table:</strong></p><pre class="crayon-plain-tag">select
	ic2.TABLE_NAME
	,ic2.COLUMN_NAME
from INFORMATION_SCHEMA.COLUMNS ic2
where table_name='tbl_ABC'
and ic2.COLUMN_NAME not in
(select column_name
from INFORMATION_SCHEMA.COLUMNS
where table_name='tbl_XYZ')</pre><p>
<strong>Result:</strong></p>
<p><img loading="lazy" decoding="async" class="alignnone size-full wp-image-6896" src="https://www.dbrnd.com/wp-content/uploads/2017/12/SQLTableColumnCompare.png" alt="SQL Table Column Compare" width="240" height="55" /></p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
