Share via


Workload Element (DTA)

Specifies the workload to be used for a tuning session.

Syntax

  
<DTAInput>  
    <Server>  
...code removed...  
    <Workload>...</Workload>  

Element Characteristics

Characteristic Description
Data type and length None.
Default value None.
Occurrence Required once for each DTAInput element.

Element Relationships

Relationship Elements
Parent element Start and Use the Database Engine Tuning Advisor
Child elements File Element (DTA)

Database Element for Workload (DTA)

EventString Element (DTA)

Remarks

A workload is a set of Transact-SQL statements that execute against a database or databases that you want to tune. The Database Engine Tuning Advisor can use Transact-SQL scripts, trace files, and trace tables as workloads.

If you specify a workload in an XML input file and a workload on the command line with the dta tool, the workload specified on the command line will be used for tuning. All tuning options specified on the command line override those that are specified in an XML input file. The only exception is if a user-specified configuration is entered in the evaluate mode in the XML input file. For example, if a configuration is entered in the Configuration element of the XML input file and the EvaluateConfiguration element is also specified as one of the tuning options, the tuning options specified in the XML input file will override any tuning options entered at the command line.

One workload must be specified for each tuning session.

Example

The following code example specifies the MyDatabase.MyDBOwner.TuningTable001 trace table for the Workload element. The TuningTable001 was created by using the Tuning template with SQL Server Profiler and saving the trace output as a table.

<DTAXML ...>  
  <DTAInput>  
    <Server>  
...code removed here...  
    </Server>  
    <Workload>  
      <Database>  
        <Name>MyDatabase</Name>  
        <Schema>  
          <Name>MyDBOwner</Name>  
            <Table>  
              <Name>TuningTable001</Name>  
            </Table>  
        </Schema>  
      </Database>  
    </Workload>  
...code removed here...  
  </DTAInput>  
</DTAXML>  

See Also

XML Input File Reference (Database Engine Tuning Advisor)