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 2008 Forums
 SSIS and Import/Export (2008)
 RANK and DENSE rank in SSIS

Author  Topic 

Shubhanshu
Starting Member

8 Posts

Posted - 2014-07-21 : 10:22:36
Hi

I need to create a package in which I have two data source one from access and another is from sql server 2005. I used merge join to obtain the dataset. But now I have to add columns which have rank and dense rank according to the column derived from Access database.

But I know we cannot use Sql server function of RANK() on Access DB. So the solution which I am think is to use the dataset obtained by merging the two data source and convert it into SQL server data source and then apply the RANK function ?

Please guide me if my approach is correct ? or is there any way I can obtain the rank of the Access db records?

tm
Posting Yak Master

160 Posts

Posted - 2014-07-24 : 15:54:23
This is another option and not because it's the best approach.

Using a Script Component with some C# (or VB) code to go through the each row data and set the rank.
The recordset must be sorted prior to using Script Component.

Basically you are looping through each row and comparing current row to previous row data and setting a output column.

Below link is example of using Script Component and not code to rank rows

[url]http://www.mathgv.com/sql2005docs/SSISTransformScriptETL.htm[/url]
Go to Top of Page
   

- Advertisement -