Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
RaisError function
Message
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Stored procedures, Triggers, UDFs
Divers
Thread ID:
01466452
Message ID:
01466456
Vues:
23
>I also don't see any point in the try catch in the calling script of the stored procedure, but the instructor wants it as well as the earliest invoice dates first. The ORDER BY clause though is causing me a problem.
>
>Here's the error message, which I received while trying to save the ALTERING of the STORED PROCEDURE:
>
>
>Msg 1033, Level 15, State 1, Procedure spDateRange, Line 35
>The ORDER BY clause is invalid in views, inline functions, derived tables, subqueries, and common table expressions, unless TOP or FOR XML is also specified.
>Msg 102, Level 15, State 1, Procedure spDateRange, Line 37
>Incorrect syntax near ')'.
>
If you're using

IF NOT EXISTS (select ...)

then, as I said, get rid of the ORDER BY.

Otherwise, can you show the exact piece of code which is failing?
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform