Open SQL Server Connection

This action opens a SQL Server connection using the defined connection string, and adds the connection to the Update Context Shared Properties collection. Other SQL Server update actions can use the connection.  The connection can also be accessed from a C# / VB.net code action through the Update Context Shared Properties collection.

The connection string can be read from a .net config file, or defined explicitly. Shared properties can also be used to define the connection string.  Using Shared Properties, the connection string can be passed in from the host application using an ApplyUpdate method overload, or retrieved from the host computer using an xml or registry action and assigned to a Shared Property, which can be used to define the connection string.

The connection can be designated to be exclusive by placing the database in single-user mode prior to opening the connection.

 

Prepare Stage

No action taken.

Execute Stage

The SQL Server connection is opened and added to the Shared Properties collection. If designated, the database is placed in single user mode.

Cleanup Stage

No action taken.

Rollback Stage

If the connection is present and still open, the connection is closed. Otherwise no action is taken.

 

Open SQL Server Connection Action Editor

Action Description - Descriptive text that can be used to identify this particular action in the Actions list.

 

Shared property to store the connection – The key value used to when the new connection is placed into the Update Context Shared Properties collection.  This is the key used by other actions in the update to access this connection.

 

Connection string – Select to define the connection string using a config file Connection Strings collection, a config file appSettings element, or by setting directly.

 

Connection string name / Connection string – The key value used to look up the connection string, or the string value of the connection string.  When setting directly, other shared property values are typically used.  Shared properties can be expanded by using the $ notation. (e.g. $MyConnStr$)

 

Place the database in single-user mode – When checked, the database connection is opened for exclusive access.  Any pending database transactions can be cancelled immediately, or the connection will wait for a specified period of time for all ongoing transactions to close.

 

Configuration file location – Identify the path and name of the config file that holds your connection string information.  This information is only necessary when configured to retrieve a connection string from the Connection Strings or appSetttings area of a config file.

 

See Also