Disable Attachments (Data Management)

License Level:BasicStandardAdvanced

Summary

Disables attachments on a geodatabase feature class or table. Deletes the attachment relationship class and attachment table.

Usage

Syntax

DisableAttachments_management (in_dataset)
ParameterExplanationData Type
in_dataset

Geodatabase table or feature class for which attachments will be disabled. The input must be in a version 10 or later geodatabase.

Table View

Code Sample

DisableAttachments example (Python window)

The following code snippet illustrates how to use the DisableAttachments tool in the Python window.

import arcpy
arcpy.DisableAttachments_management(r"C:\Data\City.gdb\Parcels")
DisableAttachments example (stand-alone Python script)

The following script illustrates how to use the DisableAttachments tool in a stand-alone script.

## GDB Attachments are no longer required, so disable attachments on the input dataset

import arcpy, os, sys

# set the geoprocessing workspace to the feature dataset LandRecord in the geodatabase City.gdb
arcpy.env.workspace = r"C:\Data\City.gdb\LandRecord"

input = "Parcels"

# use DisableAttachments to delete all attachment files from the gdb and disable attachment handling
try:
    arcpy.DisableAttachments_management(input)
except:
    print arcpy.GetMessages(2)

Environments

Related Topics

Licensing Information

ArcGIS for Desktop Basic: No
ArcGIS for Desktop Standard: Yes
ArcGIS for Desktop Advanced: Yes
11/18/2013