Re: Limit data amount in response to SELECT query



I'm using ADO with ExOLEDB to populate a recordset with e-mails.
Unfortunately, when the user has a lot of e-mails stored on the server
it takes a veeery long time to get them all.

If you are using a RecordSet you can change MaxRecords from 0 to some other
value.

And as you say, some dialects of SQL support TOP clause

The other normal way that works with all versions of SQL is to see if you
can restrict the number of rows coming back by the WHERE clause. Think about
the fields you can operate on with that for Exchange Server. You may be able
cut down rows considerably to something relevant and manageable.

I work with very large volumes of data, TV related, and we have data going
back many years.
We frequently fetch data for some specified day. It is manageable then.

Stephen Howe


.



Relevant Pages

  • Re: How to delete thousands of SQL records
    ... > crap out of the server, nearly pegging it for the duration. ... > With an actual test set, however, the service eat up almost 2GB of ram ... and the log file was never written. ... > clause generated more than a million rows and this is the problem. ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: Strange behavior of SELECTed data
    ... The order of a result set that has no ORDER BY clause depends on many ... hardware configuration of the server, ... >> You just can't rely on the mere resultset that you get after running the ... Retrieval order in the SELECT statement does not depend upon the ...
    (microsoft.public.sqlserver.programming)
  • Re: Merge Replication Performance Issues/Trace Files
    ... The update statement must have a where clause in it. ... >> on one server and the publisher on another. ... We put SQL Profiler trace on the subscriber end of the merge ...
    (microsoft.public.sqlserver.replication)
  • Re: Is there any limit to Left Join ?
    ... Nah - no practical limit (the maximum tables per SELECT statement in SQL ... Server 8.0 is 256). ... BOL you'll see it's a recursive grammar. ... If you were to join a couple hundred tables in your FROM clause you'd ...
    (microsoft.public.sqlserver.server)
  • Re: Inconsistent performance on a query
    ... Well since you insist the WHERE clause is a factor, try the query without it as such: ... I have rarely ever heard of an exact duplicate of a database on an exact OS/software/preference environment run slower on a lesser hardware machine - especially if the slower hardware is not dedicated to SQL server. ... check if your cpu or memory usage is high. ...
    (microsoft.public.sqlserver.programming)