all groups > sql server (microsoft) > june 2005 >
You're in the

sql server (microsoft)

group:

SQL 2000, SP3a "TOP 100%"


Re: SQL 2000, SP3a "TOP 100%" aaron.kempf NO[at]SPAM gmail.com
6/17/2005 3:34:33 PM
sql server (microsoft): you need TOP 100% for a view

you can't use an order by in a view without a top 100%

are you using Access Data Projects??

YAYAYAYAYAYAY
SQL 2000, SP3a "TOP 100%" RTL
6/17/2005 8:53:19 PM
Ever since we rebooted the machine, all of our views have been modified with
the "TOP 100%" We cannot seem to remove this. MS Access barks at us when we
try to modify a table and it's because of the TOP 100% text.

How to remove it...make it go away...just ignore it?

Cheers,

Rich


Re: SQL 2000, SP3a "TOP 100%" David Portas
6/18/2005 11:56:36 AM
Modify the view definition in Query Analyzer.

--
David Portas
SQL Server MVP
--

Re: SQL 2000, SP3a "TOP 100%" David Portas
6/18/2005 11:59:14 AM
[quoted text, click to view]

You don't need TOP 100% for views and you shouldn't use ORDER BY in views
either. Views are supposed to be unordered and with good reason. Queries
against the view may well perform better without an ORDER BY clause in the
view definition. The best place to use ORDER BY is when you query the view.

--
David Portas
SQL Server MVP
--

Re: SQL 2000, SP3a "TOP 100%" aaron.kempf NO[at]SPAM gmail.com
6/20/2005 10:05:24 AM
David

i'll keep order by and top 100% in views if and when i please.

Doing a sproc on top of a view is a waste of resources

Thanks
Re: SQL 2000, SP3a "TOP 100%" David Portas
6/20/2005 10:08:27 PM
You are of course welcome to use views any way you wish. However, your
second statement is incorrect if you are referring to SQL Server resources.
Ordered views are likely to consume resources compared to unordered ones
unless you are talking about an atypical scenario where a view is used to
return the same unchanging result set every time it is used.

A stored procedure over a view will not waste resources. In fact
parameterized SPs help reduce query recompiles, which is one reason why we
use them.

--
David Portas
SQL Server MVP
--

[quoted text, click to view]

Re: SQL 2000, SP3a "TOP 100%" aaron.kempf NO[at]SPAM gmail.com
6/21/2005 9:43:18 AM
i think that sprocs are over-used and views are underused.

i use views... ALLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL
the friggin time with Analysis Services
AddThis Social Bookmark Button