[quoted text, click to view] "Darren Green" wrote:
> sramshaw wrote:
> > I am attempting to join 2 tables on 2 columns with a left inner join, using a
> > merge join component. I set col1 to a sortkeypositiion of 1 and col2 to a
> > sortkeyposition of 2 (on both tables).
> >
> > This consistently fails with the following:
> >
> > 'The column with the sortkeyposition value of 0 is not valid. It should be 2.'
> >
> > I managed to get around this for a number of joins by sorting with a sort
> > component not at the oledbsource, but now I am getting this there as well.
> >
> > Is this a feature, limitation, bug or am I missing something?
> >
> > Thanks
>
> You may have already covered this, but sorting in the OLE-DB Source
> should be much more efficient. Are sure you were describing the data as
> sorted correctly? Set IsSorted on the output, and SortKeyPosition on the
> columns to match your ORDER BY clause.
>
> Some notes on sorting-
> Sorting Data
> (
http://wiki.sqlis.com/default.aspx/SQLISWiki/SortingData.html)
>
>
> --
> Darren
>
http://www.sqldts.com >
http://www.sqlis.com >
I appreciate your responses guys but I figured out how to resolve the
errors. It seems to be related to to joining on 2 columns. The first join
column needs to be in the resultset apparently. i.e. (pseudo code)
select table1.col3
from table1
inner join table2
on table1.col1 = table2.col1
and table1.col2 = table2.col2
generates the error, but this will not:
select table1.col1, table1.col3
from table1
inner join table2
on table1.col1 = table2.col1
and table1.col2 = table2.col2
Not sure at this time if the is a 'feature' or I am missing something. To
answer your questions yes, I have tried setting issorted, but that did not
help. I actually began with that because it is mandatory for a join unless
you sort the data with a sort component. Any further insights would still be