Comments

Log Parser

Comments

<comment> ::= /* text_of_comment */
-- text_of_comment

Comments are user-provided text not evaluated by Log Parser, used to document code or temporarily disable parts of query statements.


Remarks:

  • Use -- for single-line or nested comments. Comments inserted with -- are delimited by the newline character.
  • Multiple-line comments must be indicated by /* and */.
  • There is no maximum length for comments.


Examples:

A. Single-line comments

SELECT TimeGenerated, SourceName
FROM   System -- We are using the SYSTEM event log

B. Multiple-line comments

SELECT   TypeName, COUNT(*) AS TotalCount
USING    TO_UPPERCASE( EXTRACT_TOKEN(EventTypeName, 0, ' ') ) AS TypeName
INTO     Report.csv
FROM     System
/* We only want to retrieve event logs whose
   type name contains 'service'
*/
WHERE    TypeName LIKE '%service%'
GROUP BY TypeName
HAVING   TotalCount > 5
ORDER BY TotalCount DESC


© 2004 Microsoft Corporation. All rights reserved.