Showing posts with label distinct. Show all posts
Showing posts with label distinct. Show all posts

Monday, March 26, 2012

Row_Number Function

i want distinct rows from the table
i want to use "Row_Number" function with this
so
how can i use "Row_Number" function when distinct keyword is used
so i get the distinct rows as well as Row Numbers

suppose my table is as below:

Row Nos id class name

11mca sasfdfj
21mca jklj
32mca jljlj
42mca jkljljl
53mcs gghgh
64mca gghgh
73mcs gghghUsing distinct keyword is equivalent to using group by specifying all fields, so you can just use group by, and specify ROW_NUMBER as usual

Wednesday, March 21, 2012

Row number in the dataflow task

Hello all,

I got a text file with two columns. and I need to generate a integer key automatically with the row number (or any distinct number, I thought row number will be OK). and when I make the data flow task to import this text file into a raw file I need to get the unique rownumber as Id.
How can I make this in the data flow tak?

regards,

This should work for you:

http://www.ssistalk.com/2007/02/20/generating-surrogate-keys/

|||

Did you try searching the forum? That question has been asked before and several are the ways of doing it:

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=379124&SiteID=1

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1533040&SiteID=1

|||

Thank you.....

I am so happy with the script componant......

It works good.....

Thank you again.

Regards