FIX: Updating a Text Column Results in a Table ScanLast reviewed: May 1, 1997Article ID: Q135714 |
The information in this article applies to:
SYMPTOMSWhen you use the SQL Server ODBC driver version 2.50.0121 to update a text column, a table scan is performed and the update may take a very long time depending on the number of rows.
CAUSEApplications that use ODBC typically call the SQLPutData API to update text and image columns. With the new SQL Server driver, SQLPutData internally issues the following statements to the SQL Server:
BEGIN TRAN SET TEXTSIZE 2147483646 UPDATE <table-name> SET <text-column name>='#odbc#xxxxx' WHERE <search condition> SELECT TEXTPTR(<text-column name>) from <table-name> WHERE <text-column name> LIKE '#odbc#xxxxx' WRITETEXT BULK<table-name>.<text-column name> 0xxxxxxx WITH LOG COMMIT TRANThe SELECT statement uses a LIKE on the text column to get the text pointer. This causes a table scan, and if the table has a significant number of rows, takes a considerable amount of time. The overall effect is a slower UPDATE.
STATUSMicrosoft has confirmed this to be a problem in the 2.50.0121 version of the SQL Server ODBC driver. This problem was corrected in Service Pack 1 for SQL Server version 6.0. For more information, contact your primary support provider.
|
Additional query words: sql6 mfc
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |