FIX: Selecting Text or Image Field Using Table Owner's Name Causes Error

This article was previously published under Q217102
This article has been archived. It is offered "as is" and will no longer be updated.
BUG #: 18594 (SQLBUG_65)
SYMPTOMS
After applying SQL Server 6.5 Service Pack 5 or 5a, a user other than System Administrator (SA) declaring a cursor that returns a text or image column may see a 7131 error when the cursor is opened.
WORKAROUND
Use the fully qualified name of the object. For example:
   pubs.dbo.pub_info				
STATUS
Microsoft has confirmed this to be a problem in SQL Server version 6.5. This problem has been corrected in the Post Service Pack 5a Update for Microsoft SQL Server version 6.5. To install the Post Service Pack 5a Update, you must have either SQL Server 6.5 SP5 or SP5a installed.

For information about how to download and install the SQL Server 6.5 Service Pack 5a, refer to the following article in the Microsoft Knowledge Base:
197177 INF: How to Obtain SQL Server 6.5 Service Pack 5a
If you already have SQL Server 6.5 SP5 or SP5a installed, you can download the Post SP5a Update from the following article in the Microsoft Knowledge Base:
274036 INF: How to Obtain SQL Server 6.5 Post Service Pack 5a Update
For more information, contact your primary support provider.
MORE INFORMATION

Steps to Reproduce Problem

To reproduce this problem, follow these steps:
  1. Run the following T-SQL script:
       exec sp_addlogin test1, null, pubs   use pubs   exec sp_adduser test1   go   grant select on pub_info to test1   go						
  2. Next, login as test1 and run this script:
       DECLARE pub_info_cursor INSENSITIVE CURSOR	FOR SELECT pub_id, logo   FROM dbo.pub_info   OPEN pub_info_cursor						
    The open fails with the error message 7131, Level 16, State 1 error.
  3. Now connect as SA and run the same script and it works.
If the table name is fully qualified, such as ' pubs.dbo.pub_info', the error does not occur.
servsp_cursor view
Properties

Article ID: 217102 - Last Review: 10/14/2013 19:33:41 - Revision: 4.0

  • Microsoft SQL Server 6.5 Standard Edition
  • kbnosurvey kbarchive kbbug kbfix kbqfe KB217102
Feedback