In this article you will learn how to save as shapefile the feature class stored in a database, preserving the description of the fields that are governed by a domain.
The normal way to export a layer to shapefile would be to right click on the layer (a), go to the Data option (b) and press the “Export Data...” button (c); specify the path and output name using the “.shp” postfix at the end (d). As illustrated below, the output defaults to exporting domain codes instead of descriptions (e) because the original layer is a feature class stored in a database:
This can be problematic when sharing information with a third party, as the codes do not provide information unless they are interpreted and “in theory there is no option to export domain descriptions”. However, there are ways around this obstacle and the ways to do this are as follows:
Option 1 (How to create a “Join” or a Union of attributes):
Press “Open Attribute Table” (a), button shown by right clicking on the layer, and select all the rows by pressing on the “Table Options” button (b) the “Select all” option (c).
Go to the top left corner of the table (a), right click and press “Copy Selected” (b).
Open a notepad and paste what you copied in the previous step, save the notepad as illustrated in the image below.
Add a field called LINK (a), and calculate in this field the OBJECID (b).
Turn off all fields except the LINK field (a), and export the layer to Shapefile, which will serve as an intermediate or temporary file (b).
Right click on this new Shapefile (temp.shp), click on “Join and Relate” (a) and press the “Join” button (b). In the item “Choose the field in this layer that the join will be based on:” indicate the field LINK (c), in the item “Choose the table to join to this layer, or load the table from disk:” select the file “TABLE.txt” saved previously, using the button “Browse” (d), and in the item “Choose the field in the table to base the join on:” select the field the OBJECID * (e) and press OK (f).
Once Join is done, right click on the “temp” layer (a), go to “Data” (b) and press “Export Data...” (c) and save it as a shapefile (d), this way you will have the original layer with the description of the domains (e).
You can follow this procedure, or the one described in the ESRI page, both seem to me impractical. However, with the Feature Class to Feature Class tool, yes it is possible with a little tweaking, it is the only export tool that has worked for me with such tweaking, follow the steps below to make this much easier.
Option 2:
Step 1. Load the Feature Class to export into ArcMap.
Step 2. Click the Search icon (a) in the Standard toolbar. Type in the search bar (b) Feature class to feature class and click on the tool (c).
Step 3. Drag the feature class to the Input Features item (a). Specify an output folder in the “Output Location” section (b). Assign a name for the shapefile in the Output Feature Class item (c). Click on the “Environments...” button (d), in the “Field” section check the option “Transfer field domains descriptions” (e).
Step 10. Click OK in the Environment Settings window and in the original tool window also click OK to start the process.
At the end you will see that the output shapefile has the original fields with the codes, but on the back are the fields with the corresponding descriptions, these fields have a prefix “d_”. This way you have learned how to export the description of the domains to the shapefile format.
I hope you enjoyed this article, soon I will upload a video explaining the procedure that you can consult in this blog. Save my blog among your favorite links, I will be uploading many more tricks of this style, remember that you can send me your concerns in the contact page or leave your comment, I will be attentive to respond.











