Tag Archive: RegEx

  • Regular Expression to get tables from SQL query

    If you’ve not come across regular expressions (RegEx) before then you’re missing out, they’re an incredibly powerful tool for matching, extracting or validating patterns of text. I had a use case this week where I needed to take a SQL query, and quickly identify every table or view that was used in the query. RegEx to the rescue! (?<=((FROM[ \n\r]+)|(JOIN[ \n\r]+)|(APPLY[…

    » Read more
  • Pattern matching in SSIS using Regular Expressions and the Script component

    One of my favourite features of SSIS is the script component, and I know I’m not alone. Why? Because it brings the entire might of the .NET framework to SSIS, providing C# (in SQL 2008 onwards) and VB.NET extensibility for all those times where SSIS doesn’t quite have enough functionality out of the box. Such as? Well a problem I’ve come across a number of times is string parsing. Trying to search for and extract a specific pattern of…

    » Read more