General information
Category:
Coding, syntax & commands
>>>>I am attempting to create a view within SQL Server 6.5 (I don't think we added any service packs yet). It is a simple query:
>>>>SELECT * from Building Order by Building_no.
>>>>This returns a syntax error on the Order by statement. Any clues are appreciated. I checked MS KB, Tech Net, Manuals and everything says that this should work... The error message is 156 Incorrect syntax near Order.
From the SQL Server Manuals in the definition of the CREATE VIEW function:
AS select_statement
Is the SELECT statement that defines the view. It can use more than one table and other views. You must have permission to select from the objects referenced in the SELECT clause of a view you are creating.
A view need not be a simple subset of the rows and columns of one particular table. You can create a view using more than one table and/or other views with a SELECT clause of any complexity.
There are, however, a few restrictions on the SELECT clauses in a view definition:
· You cannot include ORDER BY, COMPUTE, or COMPUTE BY clauses.
· You cannot include the INTO keyword.
· You cannot reference a temporary table.
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only