<?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 Column Difference &#8211; Database Research &amp; Development</title>
	<atom:link href="https://www.dbrnd.com/tag/table-column-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.6</generator>
	<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" fetchpriority="high" 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 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 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>
