« Previous Next »

Thread: inconsistent results when running query from command line and using com objects

Last post 10-01-2008 1:17 PM by mmendenhall. 0 replies.

Average Rating Rate It (5)

RSS

Page 1 of 1 (1 items)

Sort Posts:

  • 10-01-2008, 1:17 PM

    inconsistent results when running query from command line and using com objects

    Hi,

    I am trying to use logparser to monitor avg transaction times and transaction counts using a windows service but i get different results when running the queries from the command line and from my service. For example:

    Running from the command line:

    logparser "SELECT Count(*) FROM C:\WINDOWS\system32\LogFiles\W3SVC2\ex081001.log WHERE SUB(TO_INT(TO_TIME(SYSTEM_TIMESTAMP())),TO_INT(TO_TIME(time))) <= 300

    gives me this output:

     COUNT(ALL *)

    ------------
    18

    Statistics:
    -----------
    Elements processed: 62
    Elements output:    1
    Execution time:     0.00 seconds


    Running from my service the following code:


                    string query = "SELECT Count(*) FROM " + FilePath + " WHERE SUB(TO_INT(TO_TIME(SYSTEM_TIMESTAMP())),TO_INT(TO_TIME(time))) <= 300";

                    LogQueryClassClass oLogQuery = new LogQueryClassClass();

                    COMIISW3CInputContextClassClass format = new COMIISW3CInputContextClassClass();

                    COMNativeOutputContextClassClass outformat = new COMNativeOutputContextClassClass();
                   
                    oLogQuery.ExecuteBatch(query, format, outformat);


    gives me this output:


    COUNT(ALL *)
    ------------
    62


    It looks like for some reason it spits out the elements processed instead of the result of the query..

     

    Any ideas? All help is greatly appreciated.

Page 1 of 1 (1 items)
Microsoft Communities