Solved

Linked Server / Inconsistent Metadata

Posted on 2005-02-09
2,511 Views
Last Modified: 2012-05-05
I've been getting the following error when attempting to do a 4 part query against my Linked server:

     Server: Msg 7353
     OLE DB provider 'MSDASQL' supplied inconsistent metadata.  An extra column was supplied during execution that was not found at compile time.

The error message then lists the offending field.  

I've dropped and recreated the linked server.  
One more interesting note:  If I create a view that references that linked table such as:

     Create view vPV_SOrder as Select * from OpenQuery(ServerName, 'Select * from PV_SOrder')

and then do a select on that view (Select * from vPV_SOrder), I will not get the error.

Is a 'rebuild' of the schema necessary on the Linked Server side?  SQL Server side?

This table was modified with the additional table, but there were also many other tables that had fields modified that do not return the error.

Thanks for any help.

Bill
0
Question by:bwarneke
    7 Comments
     
    LVL 34

    Accepted Solution

    by:
    Couple things, of course, dropping and recreating the link should resolve the problem, you can also change the "lazy schema" validation:

    sp_serveroption 'Your Server Name', 'lazy schema validation', false



    Brett
    0
     
    LVL 3

    Assisted Solution

    by:Terryute68
    bwarneke,

    I also remember this to be a bug. The fix at the time was to create a view just as you did.
    Here is an article that may help you fix the problem.

    http://www.sqlservercentral.com/columnists/jtravis/changingcolumn.asp

    0
     

    Author Comment

    by:bwarneke
    Thanks arbert.  I forgot to mention that I had attempted the sp_serveroption setting.  If I set the value to true, I get the following (confusing!) message:

         The 'lazy schema validation' option is ignored in this edition of SQL Server.

    We are running SQL 2000 Standard Edition.  Is it available only to Enterprise edition?


    0
     

    Author Comment

    by:bwarneke
    Thanks for the post Terryute68.  

    That looks like it would work for me.  It looks like the script needs to be run against the source DB.  But, my source data is a Progress DB.  I will check their KB to see if something similar is possible.

    Thanks.

    Bill
    0
     
    LVL 34

    Expert Comment

    by:arbert
    Ouch, that shows updating the system tables anyway--not a good idea.  Did you try to drop and recreate the linked server?
    0
     

    Author Comment

    by:bwarneke
    Yes.  Same results.
    0
     

    Author Comment

    by:bwarneke
    The issue is with the Progress DB.  The syscolumns table has an ID field.  There is a gap in the sequence.  This causes the error from SQL Server.

    There is a fix.  Drop and re-create the offending table.  The ID fields will be ordered properly when the table is re-created.
    0

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone. Privacy Policy Terms of Use

    Featured Post

    Course: MongoDB Object-Document Mapper for NodeJS

    NodeJS (JavaScript on the server) is awesome, but some developers get confused about NoSQL when it comes to working in Node with MongoDB (NoSQL database). Do you need a better explanation of how to use Node.js with MongoDB? The most popular choice is the Mongoose library.

    Suggested Solutions

    I wrote this interesting script that really help me find jobs or procedures when working in a huge environment. I could I have written it as a Procedure but then I would have to have it on each machine or have a link to a server-related search that …
    JSON is being used more and more, besides XML, and you surely wanted to parse the data out into SQL instead of doing it in some Javascript. The below function in SQL Server can do the job for you, returning a quick table with the parsed data.
    Using examples as well as descriptions, and references to Books Online, show the different Recovery Models available in SQL Server and explain, as well as show how full, differential and transaction log backups are performed
    Viewers will learn how to use the UPDATE and DELETE statements to change or remove existing data from their tables. Make a table: Update a specific column given a specific row using the UPDATE statement: Remove a set of values using the DELETE s…

    877 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    11 Experts available now in Live!

    Get 1:1 Help Now