Showing posts with label union. Show all posts
Showing posts with label union. Show all posts

Friday, March 30, 2012

How to remove unused columns and eliminate warnings

I have hundreds of these I think mainly due to the way the union all task works. Any ideas on ways to eliminate these?Select the connections in the editor and hit the delete button.
K|||

I guess I wasn't clear. Those columns are used earlier on in the data flow so I can't delete them from the connection. However I get incessant warnings about them hanging around later in the data flow.

|||Chris,

could you give us more details? How did those columns get generated?

That might give us a better idea if you can get rid of them.

Thanks,|||Just an idea... As far as I understand SSIS columns are "recreated" behind an asynchronous transform...

I.e. when you have a source with 2 fields (A and B), a derieved column task which calulates C by A+B, a sort by C passing A and B through it and a destination where you write A and C in a file you should get a warning that B is not used and can be removed... That's because B is passed through an asynchronous transform so it's a new column. And in fact, it's not used behind the sort...

At least that's how I understand SSIS...sql

Wednesday, March 7, 2012

How to rank an union of two result sets?

I am new to SQL Server Integration Services. I need to help here.

If there is only one result set, I could get rank info by putting DENSE_RANK expression inside of my select. My case is that I have two data source. After union of them, I need rank the result set and save result set plus rank info into the destination. I tried to use Derived Column component by using expression DENSE_RANK() over ( order by columnName ). But it does not like it.

Does anyone know how to achieve this?

Thanks!

Dense_rank is not a SSIS function. If you want to use the DB engine, you could write the 2 sets of data to a staging table and then use an additional dataflow with a query that does the rank over the staging table.

Another option would be to look at Jamie's rank transformation:

http://blogs.conchango.com/jamiethomson/archive/2006/09/12/SSIS_3A00_-Rank-Transform.aspx

|||

Thanks for the info. Do you know where to get the Conchango Runk transform conponent?

|||

Jun Fan wrote:

Thanks for the info. Do you know where to get the Conchango Runk transform conponent?

At the bottom of that post, there is an "Attachment" link. Click on that to get it.