Information générale
Catégorie:
Codage, syntaxe et commandes
>>>>>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.
Sorry, my mistake, I didn't realize that it was a view in SQL SERVER!! Sorry again!
Précédent
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement