Table To Geodatabase (Conversion)

License Level:BasicStandardAdvanced

Summary

Converts one or more tables to geodatabase tables in an output personal, file, or SDE geodatabase. The inputs can be dBASE, INFO, VPF, OLE DB tables, or geodatabase tables, or table views.

Usage

Syntax

TableToGeodatabase_conversion (input_table, output_geodatabase)
ParameterExplanationData Type
input_table
[input_table,...]

The list of tables to be converted to geodatabase tables. Input tables can be INFO, dBASE, OLE DB, or geodatabase tables, or table views.

Table View
output_geodatabase

The destination geodatabase where the output geodatabase tables will be placed.

Workspace

Code Sample

TableToGeodatabase Example (Python Window)

The following Python window script demonstrates how to use the TableToGeodatabase tool in immediate mode.

import arcpy
from arcpy import env
env.workspace = "C:/data"
arcpy.TableToGeodatabase_conversion(["accident.dbf", "vegtable.dbf"], "C:/output/output.gdb")
TableToGeodatabase Example (stand-alone Python script)

The following stand-alone script demonstrates how to use the TableToGeodatabase tool.

# Name: TableToGeodatabase_Example2.py
# Description: Use TableToDBASE to copy tables to geodatabase format
# Author: ESRI
 
# Import system modules
import arcpy
from arcpy import env
 
# Set environment settings
env.workspace = "C:/data"

# Make list of all tables in workspace
tables = arcpy.ListTables()
# list of tables should be similar to this: ["accident.dbf", "vegtable.dbf"]
 
# Set local variables
outLocation = "C:/output/output.gdb"

try: 
    # Execute TableToGeodatabase
    print "Importing tables to gdb: " + outLocation
    arcpy.TableToGeodatabase_conversion(tables, outLocation)
except:
    print arcpy.GetMessages()

Environments

Related Topics

Licensing Information

ArcGIS for Desktop Basic: Yes
ArcGIS for Desktop Standard: Yes
ArcGIS for Desktop Advanced: Yes
10/24/2012