<dsn-create-sql>

The <dsn-create-sql> element will create a System Data Source Name in ODBC representing a connection to a SQL Server database. This is a permanent DSN added to the host system and is not needed if an existing System DSN is already present. This element includes attributes specifying the DSN name, the database instance, SQL Server host, and authentication method (SQL or Windows). Any other parameters for a DSN are set to their defaults as configured on the host system. When using this element within a script, it is recommended that a corresponding <dsn-remove-sql> element exists to remove the same DSN created to allow for the same test script to be played multiple times on the same host system. If the DSN cannot be created a script error is thrown.

Structure

Contains:
  • None
Contained By:
  • <script>
Attributes
Name Description Data Type Default Value Required
dsn This attribute specifies the name given to the DSN. This value can contain no whitespace and must adhere to all requirements of a DSN name as specified in ODBC. string None Yes
server This attribute specifies the host system upon which the SQL Server service is running. string None Yes
database This attribute specifies the database instance to which the DSN should connect. string None Yes
authentication This attribute specifies the authentication method to be used to create a connection the SQL Server service and database. This may be one of:
  • SQL - The SQL Server authentication method. Connections made using this DSN will require the user login and password of a user account configured in the SQL Server service with permissions to access the database instance.
  • WINDOWS - The integrated Windows authentication method. The test script that uses the DSN created must be run as a Windows user known to the SQL Server system and with permissions to access the target database.
string None Yes
description This attribute can contain a text value that will be added to the System DSN as a description. string None No
overwrite This attribute specifies whether or not to overwrite an existing System DSN with the same name as the one this element will created. This is a Boolean value, with true indicating the existing DSN should be overwritten and false indicating it should not. Boolean False No
ignoreErrors This attribute specifies whether or not any errors returned when creating the System DSN should be ignored. This is a Boolean value, with true indicating errors should be ignored and false indicating they should not be ignored. If this attribute is false or not specified, any error returned when attempting to create the System DSN will result in a script error being thrown. Boolean False No
common script attributes This element includes the following common script attributes:
  • timeout
  • sleep
N/A N/A N/A