[RESOLVED] [SQL2005] Sorting in a view?
I have a Stored Procedure that selects data from a view as such
Code:
ALTER proc [dbo].[procMeetingSummary](
@top int) as
select top (@top) * from dbo.vwMeetingSummary
In the view the data is sorted by a date field however when calling this stored procedure the results are un-sorted and I have to actually add an order by to the stored procedure.
Is this a bug?
Re: [SQL2005] Sorting in a view?
A view does not sort data. You have to do the sort in the SQL statement that references the view. The order by clause will just be ignored by a view so no this is not a bug.
Re: [SQL2005] Sorting in a view?
Thanks for clarifying schaefer.