Compare Schema (Data Management)

Summary

Compares two schema reports or geodatabase schemas and produces a dynamic HTML report comparing the differences.

Learn more about creating and using schema reports

Parameters

LabelExplanationData Type
Base Source

The geodatabase, geodatabase object, or existing schema report that will be used as the base schema for comparison with the test schema.

Workspace; Feature Dataset; Table; File
Test Source

The geodatabase, geodatabase object, or existing schema report that will be used as the test schema for comparison with the base schema.

Workspace; Feature Dataset; Table; File
Output Location

The folder where the output schema comparison file will be saved.

Folder
Name

The first part of the output .html file name. The output file will have _dynamic.html appended to the specified name.

String
Formats

Specifies the file types that will be included in the output folder.

  • Dynamic HTMLThe output folder will include an .html file.
String

Derived Output

LabelExplanationData Type
Out Files

The comparison files.

File

arcpy.management.CompareSchema(in_base_source, in_test_source, out_location, name, formats)
NameExplanationData Type
in_base_source

The geodatabase, geodatabase object, or existing schema report that will be used as the base schema for comparison with the test schema.

Workspace; Feature Dataset; Table; File
in_test_source

The geodatabase, geodatabase object, or existing schema report that will be used as the test schema for comparison with the base schema.

Workspace; Feature Dataset; Table; File
out_location

The folder where the output schema comparison file will be saved.

Folder
name

The first part of the output .html file name. The output file will have _dynamic.html appended to the specified name.

String
formats
[formats,...]

Specifies the file types that will be included in the output folder.

  • DYNAMIC_HTMLThe output folder will include an .html file.
String

Derived Output

NameExplanationData Type
out_files

The comparison files.

File

Code sample

CompareSchema example (Python window)

The following Python window script demonstrates how to use the CompareSchema function.

import arcpy
arcpy.management.CompareSchema(
    "C:\temp\testing.json",
    "C:\temp\testing_II.json",
    "C:\output\location",
    "output_name",
    "DYNAMIC_HTML"
)

Environments

This tool does not use any geoprocessing environments.

Related topics