Re: How to monitor sqls executed in ado connections ?



On Thu, 05 Jun 2008 02:37:15 +0100, Brian Bushay TeamB <BBushay@xxxxxxxxx> wrote:

I would like to monitor for sqls executed through Ado library, Is there a way to hook into the library ( like an addin application into the library or service) or third party tools available for monitoring ?

I haven't seen anything like that. I suspects that the SQL just gets passed through to the OLEdb provider so you would need a tool that the provider supports

Or you could create your own "AdoQuery" (descendant or composite) which allows you to hook into the Open/ExecSQL calls and log each SQL statement and (most importantly for me) its execution time - and that logging will work regardless of the database you're connected to.

A composition wrapper also allows you to give each Query a hint about the operations you're requiring (ReadOnly or Update) and how you're going to access the result set (Sequential or Random; Single-pass or Multi-pass). Your one central Query implementation can then decide at /run-time/ details such as the best cursor type and location and whether the field values should be left in the query or got from a recordset or from an OleVariant (RecordSet.GetRows) or from... - all of which can have a significant effect on query performance.

....and you can also write yourself a much faster "Locate"!

(Although this approach may not be so good for those who want to build programs by dragging+dropping components onto a data module rather than creating the queries in program code)

--
Paul Scott
Information Management Systems
Macclesfield, UK.
.



Relevant Pages

  • Re: WH_JOURNALRECORD not working correctly.
    ... Hello and thank you very much for looking at my query. ... After a lot of messing around and posting to this newsgroup I have found out ... software on the origional PC and now the hook functions correctly. ... You can send feedback directly to my manager at: ...
    (microsoft.public.win32.programmer.ui)
  • Re: From where to download sql MSDE CLIENT TOOLS
    ... Perhaps some of the 'free' third party tools that both of us have provided ... well as on the top navigation bar to hit query when you are ... writing queries to select and insert data ends ... Manager for this. ...
    (microsoft.public.sqlserver.connect)
  • RE: microsoft query
    ... I don't think you have removed the Query since this query feature is ... part of the office suite and not part of the third party tools (Analyser, ... Access Database> then locate your database or external source... ... have also removed the microsoft query that allows my Excel 2007 to query my ...
    (microsoft.public.excel.programming)