I want to make order by ASC For specific column from more columns
A:
You should add ASC when adding order by clause for the query.
eg. Select * from Customers Order by CustomerId ASC, CustomerName
Manoj
2010-03-31 09:45:48
Thanks But I want column in stored asALTER Proc SelectAllCtageories_FrontASSelect Parent.Id,Product.Product_Id,Order By (Product.Model),Product.Image,Categories.Note With Sql2000
KareemSaad
2010-03-31 10:27:46
A:
You can't put the ORDER BY clause in the SELECT clause, it must go at the end as the above code specifies.
http://msdn.microsoft.com/en-US/library/ms188385(v=SQL.90).aspx
You'd need to do this
ALTER Proc SelectAllCtageories_Front
AS
SELECT Parent.Id,
Product.Product_Id,
Product.Model,
Product.Image,
FROM Categories
ORDER BY Product.Model ASC
What's the larger problem? Why are you needing to do this? There may be a different way to solve the problem.
Dan Williams
2010-03-31 11:38:00