<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"><channel><category>pcsoft.us.windev</category><copyright>Copyright 2026, PC SOFT</copyright><lastBuildDate>3 Oct 2017 16:22:13 Z</lastBuildDate><pubDate>3 Oct 2017 16:22:13 Z</pubDate><description>Hi All ,&#13;
WD off course has its automatic table upgrade mechanism. But sometimes your stuck with different mssql tables that you want to compare (e.g. test and production environment).&#13;
I want to share this script I found that compares the two structures and shows the differences (name, type , etc) nicely. It saved me lots of time.&#13;
&#13;
SELECT DEV.name as DEV_ColumnName, &#13;
PROD.name as PROD_ColumnName, &#13;
DEV.is_nullable as DEV_is_nullable, &#13;
PROD.is_nullable as PROD_is_nullable, &#13;
DEV.system_type_name as DEV_Datatype, &#13;
PROD.system_type_name as PROD_Datatype, &#13;
DEV.is_identity_column as DEV_is_identity, &#13;
PROD.is_identity_column as PROD_is_identity  &#13;
FROM sys.dm_exec_describe_first_result_set (N'SELECT * FROM Database1.dbo.WebUsers', NULL, 0) DEV &#13;
FULL OUTER JOIN  sys.dm_exec_describe_first_result_set (N'SELECT * FROM Database2.dbo.WebUsers2', NULL, 0) PROD &#13;
ON DEV.name = PROD.name &#13;
GO&#13;
Best Regards &#13;
&#13;
Walter (The Netherlands)</description><ttl>30</ttl><generator>WEBDEV</generator><language>en_US</language><link>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/62840-handy-mssql-script-for-comparing-two-tables/read.awp</link><title>Handy MSSQL script for comparing two tables</title><managingEditor>moderateur@pcsoft.fr (El moderador)</managingEditor><webMaster>webmaster@pcsoft.fr (El webmaster)</webMaster></channel></rss>
