« Previous Next »

Not Answered Thread: How to write space in log parser query folder path

Last post 10-09-2009 11:55 AM by ksingla. 1 replies.

Average Rating Rate It (5)

RSS

Page 1 of 1 (2 items)

Sort Posts:

  • 10-09-2009, 7:03 AM

    • togo413
    • Not Ranked
    • Joined on 09-30-2009, 3:56 AM
    • Posts 5

    How to write space in log parser query folder path

    Hi guys,

     

    My iis log folder path got space in between. It generate the error below

    Please help.

     

    Below is my code :

    path = @"C:\iis log\servera\log\"; query = @"SELECT distinct date, cs-uri-stem, cs-uri-query, cs-username, time FROM " + path + filename; query += " WHERE cs-uri-stem LIKE '%.aspx%' ";

     

    Error code : 

    Unexpected error: Error parsing query: Syntax Error: extra token(s) after query: 'log\servera\log\ex090901.log' [SQL query syntax invalid or unsupported.]
     

     

     

  • 10-09-2009, 11:55 AM In reply to

    • ksingla
    • Top 25 Contributor
    • Joined on 06-13-2006, 11:02 PM
    • Redmond, WA
    • Posts 863

    Re: How to write space in log parser query folder path

    If you set path = @"\"c:\iis log\servera\log\";\"" (notice quotes in the string itself), query will include quotes as well which should get parsed as a string correctly.

    Follow me on twitter at http://twitter.com/kjsingla
Page 1 of 1 (2 items)
Microsoft Communities