Watch the cross posts....People generally get offended if you spam all of
the SQL Server newsgroups.
Look into the indexing on the table and examine the performance of your
query within the query analyzer. You will want to insure that your query
does the following:
- Is selective in its criteria (i.e. should return a small number of records
with your WHERE argument)
-The criteria enforces the query's use of an index ( see showplan in Books
On-Line)
- The statistics for the table(simply put, how the index is distributed
across your data) has been updated (see update statistics in Books On-Line)
upon the addition of new data
If you start with the above you will likely, see a fair amount of
improvement.
Trey Johnson
Quote:> Hello,
> I am coding a VB project which queries a database (SQL server). It worked
> well at first. But now there are about 5 million recodes in the table
which
> is queried. The query often is stopped and show a window:'
[microsoft][ODBC
> SQL Server Driver] Timeout expired ' . The surprise is that it stopped at
> different point (in the VB code) and used different time when I used the
> same query. Some time, it work well on the query. (PC/NT/SQL
> Server7.0/VB6.0) Please help!
> Thank you very much!
> Williams