Menu
SharePoint Workflow Extensions Kit

Execute SQL Script

This activity executes SQL statements from within SharePoint Designer workflows.

Note: Default is MS SQL Server (System.Data.SqlClient) provider. You can use other providers like ODBC, Oracle.

Activity supports multiple batches separated by GO command. GO is not a Transact-SQL statement; it is a command recognized by the activity. The activity interpret GO as a signal that they should send the current batch of Transact-SQL statements to an instance of SQL Server. The current batch of statements is composed of all statements entered since the last GO, or since the start of the ad hoc session or script if this is the first GO.

A Transact-SQL statement cannot occupy the same line as a GO command. However, the line can contain comments.

Example: Sql script

USE AdventureWorks;

GO

DECLARE @MyMsg VARCHAR(50)

SELECT @MyMsg = 'Hello, World.'

PRINT @MyMsg

GO

SELECT @@VERSION;

GO

SharePoint Workflow Designer Phrase

Execute SQL Script this sql script using this provider name , this connection string

Parameters

Parameter Description
this sql script SQL statements. Supports multiple batches separated by GO command.
this provider name The .NET ADO Provider. Default is MS SQL Server (System.Data.SqlClient). You can use other providers like - “System.Data.Odbc” - Odbc Data Provider - "System.Data.OleDb"- OleDb Data Provider - “System.Data.OracleClient" - OracleClient Data Provider - "System.Data.SqlClient" - SqlClient Data Provider - "System.Data.SqlServerCe.3.5" - Microsoft SQL Server Compact Data Provider - Etc Additional information about providers you can find here http://msdn.microsoft.com/en-us/library/dd0w4a2z.aspx
this connection string The connection string, e.g. “Data Source=localhost\SQLExpress;Initial Catalog=test;Integrated Security=SSPI”