Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sorting a column in a View?? 1

Status
Not open for further replies.

nuVBer

Programmer
Joined
Jul 6, 2001
Messages
63
Location
US
I know SQL Server says you can't sort in a view, but is there a trick that anyone has come up with to do this?
 
There is but there is really no point in it.

A view a virtual table. So if you need the data in the view sorted, sort in the select statement.

As in.

select * from myview order by somefield

If you REALLY want to sort in the view itself, and you are running 2000. Add 'top 100 percent' to the select clause which will then allow you to add an order clause.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top