This document is archived and information here might be outdated.  Recommended version.

IWorkspace.ExecuteSQL Method (ArcObjects .NET 10.8 SDK)
ArcObjects Help for .NET developers > ArcObjects Help for .NET developers > ArcObjects namespaces > Geodatabase > ESRI.ArcGIS.GeoDatabase > Interfaces > IW > IWorkspace Interface > IWorkspace.ExecuteSQL Method
ArcGIS Developer Help

IWorkspace.ExecuteSQL Method

Executes the specified SQL statement.

[Visual Basic .NET]
Public Sub ExecuteSQL ( _
    ByVal sqlStmt As String _
public void ExecuteSQL (
    string sqlStmt
  BSTR sqlStmt
sqlStmt [in]

sqlStmt is a parameter of type BSTR

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.


The ExecuteSQL method can be used to send an arbitrary SQL statement to the underlying database for execution. The statement can be any DDL (data definition language) or DML (data manipulation language) statement but can not return any result sets. The syntax for the SQL is as required by the underlying database. The workspace supports an optional ISQLSyntax interface that provides information to applications on aspects of the SQL Syntax for the underlying database.

To determine if a workspace supports the ExecutesSQL method, an application can check the value of the canExecuteSQLworkspace property via the optional IWorkspaceProperties interface. In general, this method is only supported on local and remote database workspaces.

See Also

IWorkspace Interface