If you’re getting an error that reads “The function ‘ROW_NUMBER’ must have an OVER clause” in SQL Server, it’s probably because you’re calling the ROW_NUMBER() function without an OVER clause.
Window functions such as ROW_NUMBER() require an OVER clause (and that clause must have an ORDER BY clause).
To fix this issue, add an OVER clause when calling the ROW_NUMBER() function.