Show Navigation | Hide Navigation
You are here:
Geoprocessing tool reference > Data Management toolbox > Table toolset > Tools

Create Table (Data Management)

Release 9.2
Last modified November 29, 2010
E-mail This Topic Printable Version Give Us Feedback

Print all topics in : "Tools"


Related Topics

Creates an empty geodatabase or dBASE table.


Usage tips

Command line syntax
An overview of the Command Line window
CreateTable_management <out_path> <out_name> {template} {config_keyword}

Parameter Explanation Data Type
<out_path>

The ArcSDE, file or personal geodatabase or workspace in which the output table will be created.

Workspace
<out_name>

The table to be created.

String
{template}

A table whose attribute schema will be copied to the new output table.

Table View
{config_keyword}

The configuration keyword that determines the storage parameters of the table.

String
Data types for geoprocessing tool parameters


Command line example

CreateTable  d:\project93\data\redlands.mdb owners d:\project93\data\montgomery.mdb\owners_dat"

Scripting syntax
About getting started with writing geoprocessing scripts
CreateTable_management (out_path, out_name, template, config_keyword)

Parameter Explanation Data Type
out_path (Required)

The ArcSDE, file or personal geodatabase or workspace in which the output table will be created.

Workspace
out_name (Required)

The table to be created.

String
template (Optional)

A table whose attribute schema will be copied to the new output table.

Table View
config_keyword (Optional)

The configuration keyword that determines the storage parameters of the table.

String

Data types for geoprocessing tool parameters


Script example

# Purpose: Create a table to store customer information

# Create the Geoprocessor object
import arcgisscripting
gp = arcgisscripting.create()

try:
    # Set the workspace (to avoid having to type in the full path to the data every time)
    gp.Workspace = "e:/project93/data"

    # Process: Create the empty table
    gp.CreateTable("redlands.mdb", "customers")

    # Process: Add attribute fields to table
    gp.AddField("redlands.mdb/customers","name","text", "29")
    gp.AddField("redlands.mdb/customers","address","text", "50")
    gp.AddField("redlands.mdb/customers","zip","text","5")
    gp.AddField("redlands.mdb/customers","type","text","20")
    gp.AddField("redlands.mdb/customers","sales", "short")
    gp.AddField("redlands.mdb/customers","code", "short")
    gp.AddField("redlands.mdb/customers","own_id", "long")

except:
    # If an error occurred while running a tool print the messages
    print gp.GetMessages()

Please visit the Feedback page to comment or give suggestions on ArcGIS Desktop Help.
Copyright © Environmental Systems Research Institute, Inc.