Press "Enter" to skip to content

Using Log Parser to Preprocess Data

Lucas Kartawidjaja gives us a blast from the past:

When dealing with data inside SQL Server, especially when it’s delimited by a clear separator character, earlier versions (before SQL Server 2016) required us to write custom parsing functions—either as T-SQL user-defined functions or CLR functions. Starting with SQL Server 2016, we can use the built-in STRING_SPLIT() function to handle most of these tasks.

However, more often than not, we need to parse data that resides outside SQL Server—for example, in log files, CSV data, or other data sources. For these cases, I often use Microsoft Log Parser, a free command-line tool available here.

Click through for a demonstration of how it works. Or a reminder, if you’ve been in the business for a long long time.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.