Código SQL:
Ver original
CREATE VIEW Production.ProductsBeverages AS SELECT productid, productname, supplierid, unitprice, discontinued FROM Production.Products WHERE categoryid = 1 ORDER BY productname;
Ese código genera el siguiente error:
Msg 1033, Level 15, State 1, Procedure ProductsBeverages, Line 6
The ORDER BY clause is invalid in views, inline functions, derived tables, subqueries, and common table expressions, unless TOP, OFFSET or FOR XML is also specified.
Alguien sabe cuál es la explicación, si le pongo un TOP(n) ahí sí que funciona...
Saludos