Posts

Showing posts from January, 2016

Get the Differences between two Databases (Preferably Similar)

Run the following sql query for each database. SELECT   ST.NAME   'TABLE'             , SC.NAME   'COLUMN'            , T.NAME   'COLUMN TYPE'             ,SC.MAX_LENGTH 'LENGTH', SC.is_nullable ,object_definition(SC.default_ object_id) AS defaultVal               FROM SYS.TABLES ST INNER JOIN SYS.COLUMNS SC ON ST.OBJECT_ID = SC.OBJECT_ID INNER JOIN SYS.TYPES T ON SC.SYSTEM_TYPE_ID = T.SYSTEM_TYPE_ID             AND SC.SYSTEM_TYPE_ID = T.USER_TYPE_ID LEFT JOIN SYS.EXTENDED_PROPERTIES EX ON EX.MINOR_ID = SC.COLUMN_ID             AND EX.MAJOR_ID = ST.OBJECT_ID  order by   ST.NAME , SC.NAME Save the outputs as  .CSV files. Build an EXE file for the following code. Put the two CSV files and the exe file in a folder Run ...