XML Input File Sample with Inline Workload (DTA)

Applies to: yesSQL Server (all supported versions)

Copy and paste this sample of an XML input file that specifies a workload with the EventString element into your favorite XML editor or text editor. You can use the EventString element to specify a Transact-SQL script workload in the XML input file instead of using a separate workload file. After copying this sample into your editing tool, replace the values specified for the Server, Database, Schema, Table, Workload, EventString, and TuningOptions elements with those for your specific tuning session. For more information about all of the attributes and child elements that you can use with these elements, see the XML Input File Reference (Database Engine Tuning Advisor). The following sample uses only a subset of available attribute and child element options.


<?xml version="1.0" encoding="utf-16" ?>
<DTAXML xmlns:xsi="https://www.w3.org/2001/XMLSchema-instance" xmlns="https://schemas.microsoft.com/sqlserver/2004/07/dta">
<!-- To tune multiple databases, list them and their associated tables in the following section. -->
<!-- You can list as many tables as necessary in the following section. -->
<!-- The Weight attributes shown with the following EventString elements are optional. -->
      <EventString Weight="100.01">
        SELECT * FROM MyTableName1 WHERE
        MyColumnName1 &gt; 200
        ORDER BY ColumnName1
      <EventString Weight="10.02">
        SELECT * FROM MyTableName2 WHERE
        MyColumnName2 BETWEEN 2 AND 25000
        ORDER BY ColumnName2
<!-- The following tuning option specifies the first database to which the Database Engine Tuning Advisor connects when tuning the workload. This element is optional. -->


USE database_name statements can be specified in the inline workload that is contained in the EventString element.

See Also