BUG: Error 7356 When Using SQL 7.0 to Select From a SQL 6.5 View
ID: Q233374
|
The information in this article applies to:
-
Microsoft SQL Server version 7.0
BUG #: 55712 (SQLBUG_70)
SYMPTOMS
Under the following conditions:
- SQL Server 7.0 is used to select from a view residing on a linked SQL Server 6.5.
- The view is defined in a different 6.5 database than the 6.5 table used to define the view.
- The view selects a column from the table, which is defined as CHAR(x) NULL.
The following error will be generated:
Server: Msg 7356, Level 16, State 1, Line 1
OLE DB provider 'SQLOLEDB' supplied inconsistent metadata for a column. Metadata information was changed at execution time.
WORKAROUND
Use any of the following workarounds:
- Define the view in the same database as the table used to create the view.
- Use the CONVERT() function to convert the CHAR column to a VARCHAR in the view. For example:
CREATE VIEW My65View AS
SELECT CONVERT (VARCHAR, CharColumn) AS CharColumn FROM My65Table
- Change all CHAR(x) NULL values to VARCHAR(x) NULL values in the table.
- Create and run the view from SQL Server 7.0. For example, on SQL 7.0:
CREATE VIEW My70View AS
SELECT CharColumn FROM My65Server.My65Database.TableOwner.My65Table
GO
SELECT * FROM My70View
GO
STATUS
Microsoft has confirmed this to be a problem in SQL Server version 7.0.
Additional query words:
Keywords : kbinterop kbSQLServ700bug
Version : winnt:7.0
Platform : winnt
Issue type : kbbug