Hi Lokesh Vij,
thanks so much for your quick and HELPFUL answer. That´s right, that is exactly what I needed.
In fact, I´m loading the final table using an SSIS DFT, I used a simplify version of my query in the original question, with this part of your query was enough:
partition BY Receipt_key
ORDER BY Receipt_key, Item_Key) rnk
FROM [My Transaction Table]
The key point is the OVER statement, very useful, very handy.
Thanks again for helping me to learn something new .