Skip To Content

Create Database View


Creates a view in a database based on an SQL expression.


  • The SQL expression used to define the view is validated by the database upon execution of the tool. Therefore, valid syntax for the view definition is determined by the underlying database. If the syntax is incorrect, an error message is returned.

  • This tool is supported for databases and enterprise geodatabases. File and personal geodatabases are not supported.

  • Views created in enterprise geodatabases using this tool are not registered with the geodatabase.

  • If a spatial column is included in the view, the geometry storage type of the column must be a SQL data type (such as ST_Geometry or Geometry), not a binary geometry storage type.


CreateDatabaseView_management (input_database, view_name, view_definition)
ParameterExplanationData Type

The database that contains the tables or feature classes used to construct the view. This database is also where the view will be created.


The name of the view that will be created in the database.


An SQL statement used to construct the view.


Code sample

CreateDatabaseView example (Python window)

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

import arcpy
arcpy.CreateDatabaseView_management("c:/Connections/city_data.sde","trees","select objectid, owner, parcel from inventory where type = trees")


Licensing information

  • ArcGIS Desktop Basic: No
  • ArcGIS Desktop Standard: Yes
  • ArcGIS Desktop Advanced: Yes

Related topics