Showing posts with label external. Show all posts
Showing posts with label external. Show all posts

Tuesday, March 20, 2012

Connection Manager Keeps External Metadata information

We have a Main package and which is calling 2 more other packages.
The first package contains a connection and we are using a Dataflow task. The data flow task has OleDB Data source which is taking getting columns using a Stored Procedure. And the output we need to write in a Flat File.

The second Package also contains the same(The same Tasks, Database and Stored Procedure Calling)
The difference is in the stored procedure Parameters. Based on the different parameters Stored procedures returns the different Columns and Rows output.
When we are trying to Get the second package output in OleDb Data source it shows all the columns which is the output of the First Package because it stores External Meta Data.

So My understanding is the Connection to the same database keeps the External metadata information with the connection and because of that it is always getting the same output columns in Ole DB Data source task in the second Package also.

How to Get my correct output from the second package in this case?
Or If we dont want to store external Meta data with the Connection then is that possible? If yes then How?

Thanks in advance.

The metadata about the columns is not kept at the connection manager level; it is part of the OLE DB component. Have you tried to delete the OLE DB source component and adding a new one? Or , perhaps using the preview button.

|||Thanks for your reply.

We have tried by removing the OLEDB task and also Tried to create with New one but it didnt worked.

We also have tried using New connection and New OLE db task that also didnt worked.

Then we tried by adding the new package and the same thing happend.

But when we are using a other stored procedure with the same connection and same OLE DB Source task that works fine.
If we want to use the same with the same stored procedure name with different parameter then how it is possible?

If I want to clear the Meta data for the same then is there any way to do it?

Thanks.

Sunday, March 11, 2012

Connection in transformation component

Hi,

I'm on writing a custom data flow component (transformation). For this I need access to an external datasource. As best practice, it seems that you should use a connectionmanager in the package.

But I don't really know how to access them.

I've overwritten the AquireConnections() to lookup in the RuntimeConnectionCollection for the connection managers. But It seems it doesnt get called. If I call it my own, for example in validate (just for debugging purposes) the collection is empty, although there are two connectionmanagers in the package.

What am I doing wrong or has someone a code snippet for me.

Thanks T.

To make the package connections available within the AcquireConnection or ReleaseConnection method, (make sure you use the latter to close any connection resources), you first have define the component as having one or more connections. You do this in the ProvideComponentProperties method, so just add it and give it a name, description if you feel like it.

IDTSRuntimeConnection90 runtimeConnection = ComponentMetaData.RuntimeConnectionCollection.New();

runtimeConnection.Name = "Reference Data";

This acts as a placeholder, so that if you were to now look at the built-in Advanced UI Editor, on the first page you will see the connection listed, ready for you to choose one of the existing package connections.