Send feedback on this topic.
Teradata.Client.Provider
Stored Procedure Creation
.NET Data Provider for Teradata > Developer's Guide > Working with the Teradata Database Features > Working with Stored Procedures > Stored Procedure Creation

The .NET Data Provider for Teradata supports the creation of Stored Procedures.  In order to create Stored Procedures, the method TdCommand.ExecuteCreateProcedure must be used.  The steps to create an Stored Procedure are as follows:

  1. Connect to the Teradata server and create a TdCommand.
  2. Set the properties TdCommand.CommandType to CommandType.Text and TdCommand.CommandText to the CREATE/REPLACE procedure statement.
  3. Call TdCommand.ExecuteCreateProcedure to execute the request.

When Teradata is compiling the Stored Procedure several compilation errors or warnings can be generated.  All errors returned from Teradata are put into an error collection.  Once all the errors have been returned, a TdException is thrown.  An application can iterate through all the errors by accessing the TdException.Errors property.

Warnings are put into a warnings collection.  Once all the warnings have been collected the provider will fire a TdConnection.InfoMessage event.