Previous Next

Thread: Parameterized sql file

Last post 08-18-2008 11:18 PM by joelangley. 2 replies.

Average Rating Rate It (5)

RSS

Page 1 of 1 (3 items)

Sort Posts:

  • 08-18-2008, 4:02 PM

    • pas30339
    • Not Ranked
    • Joined on 10-20-2007, 4:18 PM
    • Posts 7

    Parameterized sql file

    Can I parameterize part of the .sql file and pass values as command line arguments so that logparser will replace the tokens at runtime with the values passed on the command line?

    I'd like to be able to code this:

    SELECT RecordNumber
    ,TO_INT(EventID)
    ,EventCategory
    ,TO_STRING(EventType)
    ,EventTypeName
    ,TimeGenerated
    ,ComputerName
    ,NULL
    ,NULL
    ,NULL
    ,NULL
    ,NULL
    ,Message
    ,HEX_TO_ASC(Data)
    ,NULL
    INTO CapturedEvents FROM %1,%2,%3

    And pass the \\<server1 IP>\Application \\<server2 IP>\Application \\<server3 IP>\Application as command line agruments.

  • 08-18-2008, 4:35 PM In reply to

    • pas30339
    • Not Ranked
    • Joined on 10-20-2007, 4:18 PM
    • Posts 7

    Re: Parameterized sql file

    I found what I think I need here:

     

    http://forums.iis.net/p/1145909/1855028.aspx#1855028

     

  • 08-18-2008, 11:18 PM In reply to

    Re: Parameterized sql file

    right, so something like: logparser -file:query.sql?param1=value1+param2=value2

Page 1 of 1 (3 items)
Page view counter