This activity executes SQL statements within SharePoint Designer workflows.
Note: The default provider is MS SQL Server (System.Data.SqlClient). You can use other providers like ODBC or Oracle.
The activity supports multiple batches separated by the GO
command. GO
is not a Transact-SQL statement; it is a command recognized by this activity. The activity interprets GO
as a signal to send the current batch of Transact-SQL statements to an instance of SQL Server. The current batch of statements includes all statements entered since the last GO
or since the start of the session if it is the first GO
.
A Transact-SQL statement cannot occupy the same line as a GO
command. However, comments can appear on the same line as GO
.
Example: SQL script
SharePoint Workflow Designer Phrase
Execute SQL Script this SQL script using this provider name and this connection string.
Parameters
Parameter | Description |
this SQL script | SQL statements. Supports multiple batches separated by the GO command. |
this provider name | The .NET ADO Provider. The default is MS SQL Server (System.Data.SqlClient ). Other providers include:– System.Data.Odbc – ODBC Data Provider– System.Data.OleDb – OleDb Data Provider– System.Data.OracleClient – OracleClient Data Provider– System.Data.SqlServerCe.3.5 – Microsoft SQL Server Compact Data ProviderAdditional information about providers can be found here. |
this connection string | The connection string, e.g., Data Source=localhost\SQLExpress;Initial Catalog=test;Integrated Security=SSPI . |