Contact us

Execute SQL Script

This activity executes SQL statements within SharePoint Designer workflows.

Execute SQL Script activity configured in a SharePoint Designer workflow

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

Example SQL script with GO batch separators entered for the Execute SQL Script activity

SharePoint Workflow Designer Phrase#

Execute SQL Script this SQL script using this provider name and this connection string.

Parameters

ParameterDescription
this SQL scriptSQL statements. Supports multiple batches separated by the GO command.
this provider nameThe .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 Provider
Additional information about providers can be found the Microsoft ADO.NET data providers reference.
this connection stringThe connection string, e.g., Data Source=localhost\SQLExpress;Initial Catalog=test;Integrated Security=SSPI.
Updated on June 18, 2026