ERROR 7352 After openrowset

  • I receive the follow error when executing a stored proc that has dynamic sql in it:

    ErrorNumberErrorSeverityErrorStateErrorProcedureErrorLineErrorMessage

    7352161NULL4The OLE DB provider "Microsoft.ACE.OLEDB.12.0" for linked server "(null)" supplied inconsistent metadata. The object "[Microsoft.ACE.OLEDB.12.0]" was missing the expected column "addingNewUDFField".

    The stored procedure just does a select * into #tmpFile from the openrowset excel file. Not sure why i'm all of sudden getting this message. If i add back in the column it works but i need the metadata to be correct and not sure where SQL is grabbing this from. I put everything into a local temp table so technically once the session ends the temp table should be removed, so how can the metadata still exist?

    Please help!

    Thanks!

  • I know this is a old post but i was wondering if anyone has a solution. I seem to have the same problem as the original poster

    Thanks in advance!

  • Hi - this is probably way too late to help you , but I hope it helps others with the same problem.

    The problem is that SQL is cacheing your query. Maybe, like me, you ran this query and then changed one of the column names in your Excel file. Since the last query was cached, it will try to execute the old query and tell you that the metadata is wrong.

    To fix this, add "OPTION(Recompile)" to the end of the (dynamic) query.

    Alternatively, " DBCC FREEPROCCACHE " would clear the entire procedure cache and make your query work.

    I hope this helps

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply