« Previous Next »

Thread: Log Parser 2.2; csv to SQL

Last post 07-07-2009 10:01 PM by volitanthorse. 2 replies.

Average Rating Rate It (5)

RSS

Page 1 of 1 (3 items)

Sort Posts:

  • 07-07-2009, 4:34 AM

    Log Parser 2.2; csv to SQL

     Hi,

     I am using log parser 2.2 to convert perfmon csv data to SQL server database, with -createTable:ON.

    The column of input perfmon csv file and the column of new generated table are consistent, it's OK.

     But I want to know that is there any way I can insert a addition customized column (not exist in input csv file) into sql server during same csv to sql operation?

     

    Thanks very much.

  • 07-07-2009, 9:24 AM In reply to

    Re: Log Parser 2.2; csv to SQL

    Yes, it is possible. Can I ask though how are you getting the data into SQL. Are you using .NET or Scripts or straight from within logparser.

    Check out my blog for other cool tips and tricks:

    http://joelangley.blogspot.com/
  • 07-07-2009, 10:01 PM In reply to

    Re: Log Parser 2.2; csv to SQL

    joelangley:

    Yes, it is possible. Can I ask though how are you getting the data into SQL. Are you using .NET or Scripts or straight from within logparser.

     

     Thanks joelangley.

    I am getting data from csv to SQL using command straight from within logparser2.2.

    Let me explain this problem more detailed:

    1, The logparser command Which I used to convert csv to sql:

     LogParser "SELECT [(PDH-CSV 4.0) (Pacific Daylight Time)(420)] AS Time, [\\******\Process(explorer)\Private Bytes] AS PrivateBytes, [\\******\Process(explorer)\Virtual Bytes] AS VirtualBytes INTO MyTable FROM C:\perflogs\perflog1.csv" -i:CSV -o:SQL -server:*******\******* -database:MyDatabase -driver:"SQL Server" -username:sa -password:******* -createTable:OFF

    2, Before I run that command, I have a database MyDatabase and a table MyTable created already.

    3, The number of column in MyTable is 4; and the number of column in csv file is 3.

     So how can I convert the 3 columns from csv into 3 columns of sql database, meanwhile, insert a customized column (which is not exist in csv file) to the 4th column of the database.

     

    Thanks very much.


Page 1 of 1 (3 items)
Microsoft Communities