Views have a number of restrictions, such as the following:

  •  You cannot add an ORDER BY to the SELECT statement in a view. A view must appear

just like a table, and tables in a relational database contain sets of rows. Sets by themselves

are not ordered, although you can apply an order to a result set using ORDER

BY. Similarly, tables and views in SQL Server do not have a logical order to their rows,

though you can apply one by adding an ORDER BY to the outermost SELECT statement

when you access the view.

  • You cannot pass parameters to views.
  • Similarly, a view cannot reference a variable inside the SELECT statement. See the

section “Inline Functions” for information on how to use functions to simulate passing

parameters to a view.

  •  A view cannot create a table, whether permanent or temporary. In other words, you

cannot use the SELECT/INTO syntax in a view.

  •  A view can reference only permanent tables; a view cannot reference a temporary

table.