BUG: Update of Text Column Using a JOIN in the UPDATE May Cause an Access Violation (283766)
The information in this article applies to:
This article was previously published under Q283766
BUG #: 19066 (SQLBUG_6.5)
SYMPTOMS
When you try to update a Text column in an update that uses a JOIN you may encounter an exception access violation (AV). The AV seems to be reproducible with specific data or a combination of data and other factors.
WORKAROUND
The access violation does not occur when:
- The Transact-SQL code is not executed as part of a stored procedure.
- The EXECUTE() command is used around the UPDATE. For example:
execute ('
UPDATE MyTable
SET MyTable.Col1 = v.Col1
FROM MyTable
INNER JOIN
Table2 v ON MyTable.Col2 = v.Col2
')
- You build an index (clustered or nonclustered) on the join column.
- You use CONVERT(varchar, ...). For example:
UPDATE MyTable
SET MyTable.Col1 = CONVERT(VARCHAR(255), v.Col1)
FROM MyTable
INNER JOIN
Table2 v ON MyTable.Col2 = v.Col2
NOTE: When converting to a varchar data type, some of the data may be truncated. Therefore, this may not be appropriate for all situations.
STATUS
Microsoft has confirmed this to be a problem in SQL Server 6.5.
Modification Type: | Major | Last Reviewed: | 10/3/2003 |
---|
Keywords: | kbBug kbpending KB283766 |
---|
|