Domanda

I have an SSIS package with a data flow task. The OLE DB source has an execute proc statement. It fails while saving with below error message.

an OLEDB record is available... The metadata could not be determined because the statement 'select appname....' in procedure is not compatible with the statement 'select appid....' in procedure

This proc has several select statements and returns the appropriate result set as per parameters passed. Any pointers to bypass this error?

È stato utile?

Soluzione

So you're saying that the SP will return different meta data depending on the parameter passed? SSIS doesn't like this - it can't update the meta data dynamically at run time. i.e. if you create a package that splits or sorts on a certain column, then you run the SP and it doesn't return that column, or the same column is a different data type, what should SSIS do? It can't automatically work it out.

I suggest you create a data source for each possibility of result set returned and conditionally execute each on as required.

In short SP's returning optionally different datasets is often not a good idea, definitely not from an ETL perspective.

Here is some code that shows how to create dynamically built output, (you could use the same method with just one output), but you'll still face the same problems downstream.

http://www.codeproject.com/Articles/32151/How-to-Use-a-Multi-Result-Set-Stored-Procedure-in

Altri suggerimenti

I ran into this issue as well. In my case, the result returned looked identical no matter which branch was executed, the difference was just in how that result was obtained (including different source tables). I simply executed all the cases with a union, and each "where" clause included the conditions for its execution instead of using "if" logic to choose a query.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top