|Important||This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here.|
How to: Integrate SQL Trace Data
SQL tracing is a tool you can use in your load tests to help you monitor and improve the performance of your Web applications. You should use SQL tracing only if your Web application uses SQL Server to store data.
SQL tracing is not restricted to Web tests. Unit tests for applications that access SQL Server databases are also good candidates for SQL tracing.
You can collect SQL trace data during a load test to analyze later. You can enable SQL tracing only in the Load Test Editor. You cannot enable SQL tracing when you create the load test with the Load Test Wizard. For more information, see.
To use SQL tracing in a load test that is run locally on a computer that is running Windows Vista, you must be a member of the sysadmin role on the SQL Server instance that is being traced. To fix this problem, a SQL Server administrator must add you to the sysadmin role.
To enable SQL tracing for a load test run
Open a load test in the Load Test Editor.
Right-click the active Run Settings node for your load test and then click Properties.
The Properties window is displayed.
Set the SQL Tracing Enabled property. True indicates that SQL Tracing is enabled; False indicates that it is not.
Set the SQL Tracing Connect String property. Type the connection string of the SQL server you want to monitor, or click the ellipsis button to open the Connection Properties dialog box.
Set the SQL Tracing Directory property. Type a folder in which to store the SQL trace data. The path must be accessible to the SQL Server and the client that is running Visual Studio Team Edition for Testers.
Set the Minimum Duration of Traced SQL Operation property. Type a value for the minimum duration of traced queries. For example, 500 indicates that all queries that take longer than 500 are traced. The units are in milliseconds. For SQL Server 2005, the units are in microseconds.
Save and run your test.
You can view the SQL Tracing data only after your load test has completed. For more information, see.