Click here to Skip to main content
15,891,184 members
Home / Discussions / Database
   

Database

 
GeneralCount number of records in related tables Pin
Kevin Brydon24-Apr-08 0:54
Kevin Brydon24-Apr-08 0:54 
GeneralRe: Count number of records in related tables Pin
Ashfield24-Apr-08 1:30
Ashfield24-Apr-08 1:30 
GeneralRe: Count number of records in related tables Pin
Kevin Brydon24-Apr-08 2:49
Kevin Brydon24-Apr-08 2:49 
GeneralRe: Count number of records in related tables Pin
Ashfield24-Apr-08 3:18
Ashfield24-Apr-08 3:18 
GeneralDiff b/W ADO & ADO.net Pin
sonia.sardana23-Apr-08 23:46
sonia.sardana23-Apr-08 23:46 
GeneralRe: Diff b/W ADO & ADO.net Pin
Mycroft Holmes24-Apr-08 20:19
professionalMycroft Holmes24-Apr-08 20:19 
GeneralTimeout Exception [modified] Pin
Vimalsoft(Pty) Ltd23-Apr-08 23:25
professionalVimalsoft(Pty) Ltd23-Apr-08 23:25 
GeneralRe: Timeout Exception Pin
Mike Dimmick24-Apr-08 4:15
Mike Dimmick24-Apr-08 4:15 
To stop queries from taking a very long time to return and consuming resources on the server unnecessarily, and to stop them from blocking client software for an unbounded length of time, ODBC and other database communication libraries include timeouts on both the connection to the server and on executing a command.

Given your description I'd imagine you're using the ADO objects with the MSDASQL provider, possibly through a DSN, using the Microsoft SQL Server ODBC driver. You might get better results using the SQLOLEDB provider to remove some of the layers. In either case, you should be able to use the Command object's CommandTimeout property to set a more sensible timeout for your operation. The default timeout is 30 seconds.

If instead you're looking to reduce the amount of time taken to execute a given query, you need to look carefully at how the query is written and what indexes you have to support that query. Ideally you want a single index which contains all the columns that appear in your WHERE clause which are searchable (that is, using simple comparison operators to compare the column's actual value against some provided value). LIKE is searchable if you're searching for a prefix, that is, the wildcards appear after some static text (e.g. 'CP%'). Do be aware that the more indexes you have, the longer INSERT and UPDATE operations will take. Generally you have to plan your set of indexes across all the operations that will take place on a table.

Finally one reason that queries start to take longer amounts of time is if historical data accumulates in the table. Consider archiving data to a different table or database when it is no longer current, or even deleting it outright.


DoEvents: Generating unexpected recursion since 1991

GeneralRe: Timeout Exception Pin
Vimalsoft(Pty) Ltd24-Apr-08 20:09
professionalVimalsoft(Pty) Ltd24-Apr-08 20:09 
GeneralRe: Timeout Exception Pin
GuyThiebaut24-Apr-08 5:52
professionalGuyThiebaut24-Apr-08 5:52 
GeneralRe: Timeout Exception Pin
Vimalsoft(Pty) Ltd24-Apr-08 20:03
professionalVimalsoft(Pty) Ltd24-Apr-08 20:03 
GeneralDropping all Tables Pin
Broken Bokken23-Apr-08 16:10
Broken Bokken23-Apr-08 16:10 
GeneralRe: Dropping all Tables Pin
Harini N K23-Apr-08 20:44
Harini N K23-Apr-08 20:44 
GeneralRe: Dropping all Tables Pin
Broken Bokken24-Apr-08 2:25
Broken Bokken24-Apr-08 2:25 
GeneralMissing table in SQL Server Pin
blakey40422-Apr-08 22:59
blakey40422-Apr-08 22:59 
GeneralRe: Missing table in SQL Server Pin
Marek Grzenkowicz22-Apr-08 23:36
Marek Grzenkowicz22-Apr-08 23:36 
GeneralRe: Missing table in SQL Server Pin
blakey40422-Apr-08 23:49
blakey40422-Apr-08 23:49 
GeneralRe: Missing table in SQL Server Pin
Marek Grzenkowicz23-Apr-08 1:27
Marek Grzenkowicz23-Apr-08 1:27 
AnswerRe: Missing table in SQL Server Pin
blakey40423-Apr-08 1:55
blakey40423-Apr-08 1:55 
GeneralConnectivity with SQl database Pin
Sankalp Verma22-Apr-08 22:56
Sankalp Verma22-Apr-08 22:56 
GeneralRe: Connectivity with SQl database Pin
Marek Grzenkowicz22-Apr-08 23:37
Marek Grzenkowicz22-Apr-08 23:37 
GeneralRe: Connectivity with SQl database Pin
Broken Bokken24-Apr-08 3:01
Broken Bokken24-Apr-08 3:01 
Generaltable-value function from ADO Pin
Green Fuze22-Apr-08 22:39
Green Fuze22-Apr-08 22:39 
AnswerRe: table-value function from ADO [modified] Pin
andyharman23-Apr-08 23:19
professionalandyharman23-Apr-08 23:19 
GeneralRe: table-value function from ADO Pin
Mark J. Miller24-Apr-08 10:17
Mark J. Miller24-Apr-08 10:17 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.