On this page

COMPARE TABLE STRUCTURE

Core command CM TA ST CMTAST

Compares the columns of a table between the current connection and another connection.

Syntax

COMPARE TABLE STRUCTURE [<schema>.]<table> WITH <connection>

Arguments

ArgumentRequiredValuesDefault
<table>YesThe table to compare, found on each sideNone
<schema>.NoThe schema of the table on both sides, followed by a dotEach side's current schema
WITH <connection>YesAn active connection of the CDFNone

Examples

COMPARE TABLE STRUCTURE CUSTOMER WITH B;
COMPARE TABLE STRUCTURE SALES.ORDERS WITH PROD_DB;

Details

The other connection

The other connection must be an active connection of the CDF. The command opens its own short-lived connection to it; the current connection stays open and unchanged.

Finding the table on each side

Without a schema, each side uses its own current schema. The name is then tried as typed, in upper case and in lower case, on each side separately, as DESCR does, since two database products may store an unquoted name in a different case.

Report

  • the columns that exist on one side only;
  • the columns that exist on both sides with a different type, size, decimal digits or nullability, with both definitions;
  • the number of columns that match exactly.

When everything matches, a single line says the structure is identical. The command fails when the table does not exist on one side, or when the connection is not defined.

Used in these how-tos

Last modified in release 5.5.0.

Found something wrong or unclear on this page? , with the page address.