Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL Server - ORDER BY Syntax Error?
Message
From
20/10/1997 13:31:08
Sonny Chouinard
CHCA Computer Systems Inc.
Lachenaie, Quebec, Canada
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00054476
Message ID:
00055566
Views:
31
>>>>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.
>>>>tia
>>>>
>>>>Steve
>>>
>>>I just found a note in a third party book that says ORDER BY is not permitted in a view. What is this?
>>
>>Third party book has to be wrong. Views would be worthless if we could not use an ORDER BY clause. As long as the column BUILDING_NO is a valid column in the table, you should be able to use it in the ORDER BY clause. Are you using the SQLExec() function to issue thge query? View Designer?
>
>Remember this is SQL Server 6.5 not VFP. I have run various tests and sure enough, the ORDER BY is not allowed. Unless, I am doing something off the wall. Any SQL Server guru's out there?

I've run some test with SQLEXEC and I didn't have any problem with ORDER BY.
The only thing different with VFP is the GROUP BY clause. Make sure the syntax
is correct.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform