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

Posted on 2006-04-22
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

    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

    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

    Highfive + Dolby Voice = No More Audio Complaints!

    Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

    Join & Write a Comment

    Introduction After workin in a plethora of programming languages like C, Pro*C, ESQL/C, C++, VC++, VB, Java, HTML,JavaScipt etc, technologies and frameworks like JSP, Servlets, Struts, Spring, IBatis etc and databases like MS Access, SQLServer, Inf…
    APEX (Application Express) is used to develop a web application from Oracle. SQL Workshop is one of the tools that comes with Oracle APEX to query or modify the database objects or to make any changes to the structure.
    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…
    Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

    730 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

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now