Opens a database connection using the specified custom connection string or predefined connection string. The connection is identified by a unique session name, which can be referenced by subsequent SQL steps. This allows multiple SQL connections to run simultaneously. Use the Close SQL Connection action to close a SQL connection that is currently open. This action also provides the option to create and name a new pre-defined connection string that can be used in subsequent steps and tasks. Used to establish a persistent connection for use with other Database steps.
Declaration
<AMSQLOPENCONNECTION SESSION="text" PREDEFINEDCONNECTION="text%" />
Example
Establish SQL connection using predefined connection string named "%theconnection%". SQL session name is "SQLSession10".
<AMSQLOPENCONNECTION SESSION="SQLSession10" PREDEFINEDCONNECTION="%theconnection%" />
See Also: Close SQL Connection, Stored Procedure, Loop Dataset, Data Link Properties
Property |
Type |
Required |
Default |
Markup |
Description |
Session Name |
Text |
Yes |
SQLSession1 |
SESSION="SQLSession2" |
Specifies the session name of the SQL connection to open. |
Connection String - Custom |
Text |
Yes |
(Empty) |
CONNECTIONSTRING= "AM1P2qCkbYiFHdqWN7qDphOEw==aME" |
Specifies a custom OLEDB connection string. The connection string provides driver, server, username, password and other important information to the OLEDB subsystem so that the connection can be made. The easiest way to generate a proper connection string is by clicking New in the visual step editor. This opens the Data Link Properties Wizard allowing you to setup a custom connection string. |
Connection String - Pre-defined |
Text |
Yes |
(Empty) |
PREDEFINEDCONNECTION= "%MyPreDefinedConnection%" |
Specifies a pre-defined OLEDB connection string. An existing pre-defined connection string can be specified by name, or a custom connection string can be defined as above, named, and stored. A newly created pre-defined connection string will be available for use in subsequent steps of the task. |