[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now


what does this mean - 'SELECT     TOP 100 PERCENT' in a select statement of SQL Server

Posted on 2006-04-22
Medium Priority
Last Modified: 2006-11-18

I didn't type this code 'TOP 100 PERCENT ' in my Select statement in SQL Server 2k by myself, it is generated automatically, what does it mean?

SELECT     TOP 100 PERCENT myfield1, my field2,...
Question by:jc50967w
LVL 75

Accepted Solution

Aneesh Retnakaran earned 1000 total points
ID: 16515119
From my understanding, there would be no benefit from using, or not using, the TOP 100 PERCENT clause in a Select query. However, if you've ever worked with the Query Designer in the Views pane, you may know that whenever you save a new view, SQL Server graciously adds the clause into the SQL for you, at no extra charge. So, if you're in the habit of copying and pasting SQL code after using the Query Designer to create it, you might find it less of a nuisance to just leave it in. It's a curious "feature" of SQL Server.

I think the only benifits of using TOP 100 PERCENTAGE is that, creating a view that orders the results

Author Comment

ID: 16515257
I feel much clear after read your post. You described what exactly happened in my programming. I do use Query Designer, and copy and paste the code in a new view sometimes, an Order operator is in the code.

thank you very much.

Featured Post

Prep for the ITIL® Foundation Certification Exam

December’s Course of the Month is now available! Enroll to learn ITIL® Foundation best practices for delivering IT services effectively and efficiently.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this blog post, we’ll look at how ClickHouse performs in a general analytical workload using the star schema benchmark test.
In this blog post, we’ll look at how using thread_statistics can cause high memory usage.
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses

834 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question