Skip to main content

SqlCommand

Suggest edit Updated on November 10, 2021

Use SQLCommand when the data source resides in a Microsoft SQL Server database and you want to perform update, insert, or delete commands on the database.

The SQLCommand requires SQL Server 7.0 or greater. The SQLCommand wraps .NET’s SQLConnection component. Note you cannot return data using this component.

Properties

PropertyDescription
Command

The SQL Insert, Update, or Delete statement. Here is an example:

Insert into AQM (AgentID, start, StartStatus, stop, StopStatus, Annotation, AnnotationStatus) Values (AgentID, 'StartDate','StartStatus', getdate(), 'Today', 'Call Recorded', 'True')

Note: Include single quotes with string variables as 'var'.

When you use a statement containing variables, input data ports will appear on the Execute connection block. Here is an example:

Example
ConnectionString

The string used to open the data source. To create the Connection String, browse this property to open the Connection String Editor window. Here is an example:

Connection string editor

In this case the connection string entered was:

Server=".";Initial Catalog="AQM";User Id=sa;Password=

Once you have entered a connection string, click the Test button to verify the connection.

Methods

MethodDescriptionParametersResult Type
ExecuteThe Execute method design block is displayed on the automation when you add the SQLCommand component. Trigger the method to execute the command. As required by Command Void
Did you find this content helpful? YesNo

Have a question? Get answers now.

Visit the Support Center to ask questions, engage in discussions, share ideas, and help others.

We'd prefer it if you saw us at our best.

Pega.com is not optimized for Internet Explorer. For the optimal experience, please use:

Close Deprecation Notice
Contact us