PRB: Access Violation Exception Occurs When Optimized Query Plan Uses Hash Match Team Operator (818671)
The information in this article applies to:
SQLBUG_70:200017 SYMPTOMSIf the query plan uses Hash Team operators during query
optimization, an access violation exception may occur in a SELECT statement.
Query plans use Hash Team operators in the following two situations:
- If the query performs two or more joins on the same set of
columns.
- If the query performs a grouping operation with one or more
joins on the same set of columns.
WORKAROUNDTo work around this problem, enable trace flag 8679. Trace
flag 8679 prevents the SQL Server optimizer from using a Hash Match Team
operator during query optimization. To enable trace flag 8679, use one of the
following methods. Method 1: Use the Transact-SQL DBCC TRACEON Statement- To enable the trace flag for the current client connection,
run the following code in SQL Query Analyzer:
DBCC TRACEON (8679) - To enable the trace flag for all the client connections,
run the following code in SQL Query Analyzer:
DBCC TRACEON (8679,-1) Note If you enable the trace flag by using DBCC TRACEON, enable the trace flag each time that you restart SQL Server. Method 2 : Use the Transact-SQL Server Startup Parameter To set a server-wide trace flag, use the Transact-SQL Server
startup parameter. To do so, follow these steps:
- In SQL Server Enterprise Manager, right-click
<server name>, and then click
Properties.
- Click the General tab, and then click
Startup parameters.
- Type the following text in the Parameter
box: -T8679
- Click Add, and then click
OK two times.
- Restart the MSSQLServer services.
For additional information about SQL Server startup
parameters, click the following article number to view the article in the
Microsoft Knowledge Base: 200103
INF: SQL Server 7.0 Startup Parameters
REFERENCES
For more information, click the following article number to view the article in the Microsoft Knowledge Base:
275304
FIX: Access Violation with Queries that Involve Hash Join on Large Data Sets
Modification Type: | Minor | Last Reviewed: | 1/18/2006 |
---|
Keywords: | kbTSQL kbprb KB818671 kbAudDeveloper |
---|
|