Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 SSIS and Import/Export (2005)
 Script Component Output Problem

Author  Topic 

loudbliss
Starting Member

37 Posts

Posted - 2008-04-08 : 16:22:30
Hi Guys,
I have a Data Flow which consist in a Flat File Source connected to a Derived Column that is connected to an Ole DB Destination

In the same Data Flow i have an script source task which i want to connect to the same Ole DB Destination mentioned before.

I cannot do that because it says that the destination component does not have any available imputs for use in creating a path.

I know the Script Source Task has an Output Column because i verified it.

Is it possible to connect a flat file source AND a script source to the same Ole DB Destination?

nr
SQLTeam MVY

12543 Posts

Posted - 2008-04-08 : 16:51:53
The way you are trying to do it would mean joining the sets - that's why there's only one input for the destination.
You have to decide how the two sets are combined for output - do you want a union or join?

==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page

loudbliss
Starting Member

37 Posts

Posted - 2008-04-08 : 17:12:10
nr it would be an union, since in the firs set i have all the data tha is in the flat file and in the other set (the script source) im only retreving the info of the flat file (datecreated, size, etc).
Go to Top of Page

nr
SQLTeam MVY

12543 Posts

Posted - 2008-04-08 : 17:19:46
Can't be a union as they are different structures.
Sounds like they should be separate outputs with the file info going to a batch table and the data to another (maybe with a batch id).

==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page

loudbliss
Starting Member

37 Posts

Posted - 2008-04-08 : 17:23:15
i guess i cant do a join since theres no columns that are the same.

my flat file and my script only return one row each.

is it possible to do i with a join?
Go to Top of Page

nr
SQLTeam MVY

12543 Posts

Posted - 2008-04-08 : 17:34:04
Try a merge join.
You may have to put in a sort and maybe derived columns to do the join but it should work and as you only have one row each performance won't be an issue.

There's probably an easier way.

==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page

loudbliss
Starting Member

37 Posts

Posted - 2008-04-08 : 17:55:09
nr, i added a derived column and a sort task for each source and tried to merged it but i gives me the following error:
Both inputs of the transformation must contain at least one sorted column, and those columns must have matching metadata.



It opens the Restore Invalid References Editor which i dont understand.
It has an Invalid Input, Invalid COlumn References and Available Columns.

But i really dont now how should i map the columns there
Go to Top of Page

loudbliss
Starting Member

37 Posts

Posted - 2008-04-09 : 09:01:22
nr, got the job done.

Is essentially what you told me but with a little tweak.

I had to add a derived column to both of the sources called TaskId with a value = 1 in order to be able to do the join.

It works for me but its a limited solution.

Thanx for your help
Go to Top of Page
   

- Advertisement -