Howdy all. I am getting an error with SQL Server 2000. I am pulling data from one server to another using Linked Servers. I am getting the following error:
OLE DB provider 'SQLOLEDB' supplied inconsistent metadata. The object '[<IP>].[<Database>].[dbo].[<Table>]' was missing expected column '<ColumnName>'. [SQLSTATE 42000] (Error 7352).
The perplexing thing to me about this problem, is that I am getting the error when I run a particular stored procedure within a SQL Server Agent Job. However, I run the stored procedure several times within that job, and it works the first couple of times. It fails on the same job step every time, but yet it works on other steps that do the same thing -- just with different tables and columns.
Any help would be greatly appreciated.You may have already tried this - but have you deleted the step and added the step back ?|||No, I have not tried this yet, but I will try it. I am having this problem at several servers which are all pulling from the same linked server.
Thanks for the suggestion.
Originally posted by rnealejr
You may have already tried this - but have you deleted the step and added the step back ?|||Was a column (or anything else) modified/deleted ?|||No. I thought of that, too. Nothing has been done to the table or its columns.
Originally posted by rnealejr
Was a column (or anything else) modified/deleted ?|||Let me know if deleting the step works - something may have gotten corrupted.|||I deleted the whole SQL Agent job and readded it. I am still getting the inconsistent metadata error. It happens on and off. It will work sometimes for several of the servers that are pulling data, but most of the time I get the metadata error.|||Is it the same column/table every time ? If so, what is the data type of the column ? Are you linking to sql server 2000 servers only ? Do you know where it is failing within the sp - can you post the code where it is failing ?|||It is the same table/column everytime. It is the same step in the job every time. The sp is executed several times within the job, and it works successfully several times, but when it fails it always fails on this step. Here is the code that it is failing on:
--------------
SELECT @.Command = @.Command + 'DECLARE tmpCursor CURSOR READ_ONLY FOR' + Char(13)
SELECT @.Command = @.Command + 'SELECT distinct ' + Char(13)
SELECT @.Command = @.Command + ' o.O_ID' + Char(13)
SELECT @.Command = @.Command + 'FROM' + Char(13)
SELECT @.Command = @.Command + ' [' + @.SourceServerName + '].Mugshot.dbo.Objects o,' + Char(13)
SELECT @.Command = @.Command + ' [' + @.SourceServerName + '].Mugshot.dbo.SubObjects so,' + Char(13)
SELECT @.Command = @.Command + ' [' + @.SourceServerName + '].Mugshot.dbo.FieldInstanceObjects fio,' + Char(13)
SELECT @.Command = @.Command + ' ' + @.DestImageTableName + ' i,' + Char(13)
SELECT @.Command = @.Command + ' xFer_R_ID r' + Char(13)
SELECT @.Command = @.Command + 'WHERE' + Char(13)
SELECT @.Command = @.Command + ' r.R_ID = i.Parent_R_ID AND' + Char(13)
SELECT @.Command = @.Command + ' i.' + @.DestImageColumnName + ' = fio.FI_ID AND' + Char(13)
SELECT @.Command = @.Command + ' fio.O_ID = o.O_ID AND' + Char(13)
SELECT @.Command = @.Command + ' so.Full_O_ID = o.O_ID' + Char(13)
--------------
Basically, I am declaring a cursor within a string, so the SourceServer can be dynamically specified. All SourceServer's are SQL Server 2000. I use Linked Servers to access the SourceServer's (sp_addlinkedserver).
Thanks for your time.
Originally posted by rnealejr
Is it the same column/table every time ? If so, what is the data type of the column ? Are you linking to sql server 2000 servers only ? Do you know where it is failing within the sp - can you post the code where it is failing ?
No comments:
Post a Comment