ArcObjects Library Reference (GeoDatabase)  

IWorkspace.ExecuteSQL Method

Executes the specified SQL statement.

[Visual Basic .NET]
Public Sub ExecuteSQL ( _
    ByVal sqlStmt As String _
)
[C#]
public void ExecuteSQL (
    string sqlStmt
);
[C++]
HRESULT ExecuteSQL(
  BSTR sqlStmt
);
[C++]

Parameters

sqlStmt [in]   sqlStmt is a parameter of type BSTR

Product Availability

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

Remarks

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