I have tried the following query in Microsoft SQL Server Management Studio:
select
ROW_NUMBER() OVER(ORDER BY ret_id, dep_id DESC) AS 'Row Number'
from
Round_Trip_View
and it works.
I have tried the same to create a view, and it crashed.
Any idea?
I am looking to assign a kind of id for each row in my view and I appreciate any alternative ideas :)
The problem was the view wizard.
What I learned: never use the wizards when you can code! :)