all groups > sql server mseq > october 2003 >
You're in the

sql server mseq

group:

ORDER BY clause in views



ORDER BY clause in views dotan
10/22/2003 7:48:40 AM
sql server mseq: hi just wante to know the reason why is the
ORDER BY clause INVALID in views ??

thanx.
Re: ORDER BY clause in views Vishal Parkar
10/22/2003 8:59:11 PM
Dotan,

[quoted text, click to view]

Not sure why is it so, probably by syntax. But the workaround is to use TOP clause in
SELECT query. Because if you do so you get an error as "The ORDER BY clause is invalid in
views unless TOP is also specified"

See following example.
use northwind
go
create view v_customers
as
select top 100 percent * from customers
order by customerid
go

--
-Vishal

AddThis Social Bookmark Button