Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
ORDER BY in sp?
Message
From
22/05/2001 17:03:33
 
 
To
All
General information
Forum:
Microsoft SQL Server
Category:
Stored procedures, Triggers, UDFs
Title:
ORDER BY in sp?
Miscellaneous
Thread ID:
00510084
Message ID:
00510084
Views:
55
I have a query that works if I run it from Query Analyzer but is rejected when I try to create a stored procedure with it:

SELECT A.AreaID, B.Zip, C.MedianIncome, C.Total, C.QZip, D.EstimatedQty,
D.OrderQty
FROM QZipAreaOrder A JOIN Zipcross B ON A.AreaID=B.AreaID
LEFT JOIN HouseholdData C ON B.Zip=C.Zip
LEFT JOIN QZipSelections D ON A.QZipAreaOrderID=D.QZipAreaOrderID
AND B.Zip=D.Zip
WHERE A.QZipOrderID=1
AND A.AreaID=592
ORDER BY C.MedianIncome DESC

I get an "Incorrect syntax near keyword 'ORDER'" error. What's wrong with this query?
It's "my" world. You're just living in it.
Next
Reply
Map
View

Click here to load this message in the networking platform