473,322 Members | 1,307 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Order By in a View

Hi everyone,
I'm relatively new to MSSQL.
I was trying to import a view from MS Access to MSSQL that has an order by statement.

And everytime I tried it gave me the following error:
"The ORDER BY clause is invalid in views, inline functions, derived tables, and subqueries, unless TOP is also specified."

ِAnyone can help?

M.
Oct 1 '07 #1
2 1726
ck9663
2,878 Expert 2GB
Hi everyone,
I'm relatively new to MSSQL.
I was trying to import a view from MS Access to MSSQL that has an order by statement.

And everytime I tried it gave me the following error:
"The ORDER BY clause is invalid in views, inline functions, derived tables, and subqueries, unless TOP is also specified."

ِAnyone can help?

M.

option 1. place the ORDER BY on the code where you call the view

option 2. include a top 100% on your view. or use a ridiculous large number that will ensure return of all rows
Oct 1 '07 #2
Excellent, the select top 100 percent ....
worked like magic for me:)

Thanks:)

option 1. place the ORDER BY on the code where you call the view

option 2. include a top 100% on your view. or use a ridiculous large number that will ensure return of all rows
Oct 2 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

7
by: svilen | last post by:
hello again. i'm now into using python instead of another language(s) for describing structures of data, including names, structure, type-checks, conversions, value-validations, metadata etc....
1
by: Scott | last post by:
I have a view that contains the following SQL1 and it takes about 500ms to run with Explain Plan EXP1. However, if I add an order by clause(e.g. select * from view1 order by ID desc), it will then...
12
by: Irene | last post by:
Hi all again, Well, I have my Athletics database with Athletes, Competitions, Scores tables. I have a ranking query where I get back the list of the competitions-athletes and scores...
2
by: elein | last post by:
Yes, I vacuumed. Reproduced on both 7.3.2 and 7.5. Brain dead java beans want order by clauses in views that they use. my view is: select .... from bigtable b left join lookuptable l order...
104
by: Beowulf | last post by:
I have the view below and if I use vwRouteReference as the rowsource for a combo box in an MS Access form or run "SELECT * FROM vwRouteReference" in SQL Query Analyzer, the rows don't come through...
3
by: Beowulf | last post by:
I was just messing around with some ad hoc views and table returning UDFs today so I could look at and print out data from a small table and noticed something strange. If I stick my select...
24
by: Hurricane | last post by:
When I create a view in SQL and include an ORDER BY clause i can see it in Management Studio. However, when I call the same view from an ASP page the order goes completely haywire. Any ideas?
4
by: Jer | last post by:
I am using Access 2003 as a front-end to a SQL Server 2005 database. I make design changes using SQL Server Management Studio. I have a table that includes a datetime column. I create a view and...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.