Category: Snowflake

  • Querying History By Sessions in Snowflake

    Querying History By Sessions in Snowflake

    Last time, we talked about a query using the Query_History_By_User table function in Snowflake. This time, I want to discuss a similar table function named Query_History_By_Session. Thankfully, it works in a very similar fashion to Query_History_By_User. Yes, it shows the same information as Query_History_By_User, so I am not displaying it here. By the table function…

  • Cool Items in Snowflake that Aren’t in SQL Server

    Yes, I know. The name of today’s post is certainly clickbait. But it’s true! There are so many things you can do in Snowflake that may – or may not – be possible in SQL Server, at least not without several tricks and possibly low-level querying. So, let’s start shall we? What did I run?…

  • Common Table Expressions Can Be A Good Thing

    Most of our coding these days has Common Table Expressions, also known as CTEs. If not, you’re either working on an older version of SQL Server or you haven’t been introduced to this piece of goodness. CTEs can make reading SQL queries a lot easier if the logic is convoluted. For example, let’s use the…

  • Basic Analysis of Data with Snowflake

    Now and again, you’ll be asked to do some basic analysis of your data in Snowflake. Now by “basic analysis,” I mean for each column tell how many rows are populated, what’s the largest and smallest value in the column, etc… Some of you will want to review each and every column of every table…

  • Removing Objects Is Not So Simple

    When you’re working between SQL Server and Snowflake, there can be a lot of crossover that may make you forget what system you’re working in. Sometimes it’s close, but not close enough. Today, let’s go over something that should be rather simple – removing old objects that we shouldn’t need any longer. In SQL Server,…

  • Making Python work with Snowflake For Fun and Pleasure

    As we did last week in our post on Creating a new function in Snowflake, I want to talk about some of the scripts and languages I use to make my life easier in Snowflake. As the site LearnPython says: “Today, Python is one of the most popular programming languages because of its beginner-friendly syntax, efficiency, and…

  • Creating a new function in Snowflake

    Sometimes, you’ll need to create functions that do a particular thing. They’re not always pretty. Some of them look like they should have been thrown out with the bathwater. Unlike SQL Server, user-defined functions in Snowflake can be done in several different languages. They can be done in Java, JavaScript, Python, Scala, or plain-old SQL.…

  • Different ways to get to the same thing

    When you’re trying to complete a task for the business, the most important thing is to get the data right. Second most important task is to get the data quickly. One of the ways we can get better at speed is to attempt several slightly different ways that can get you (hopefully) the same data.…

  • Check Out these URLs with Snowflake Functions

    When we’re working with fields that have websites in them, one of the things that we should be doing with them is to double-check that they’re well-formed and usable. Thankfully, Snowflake has a function just for that. With the PARSE_URL function, we can check out if everything is properly formed – meaning that we have…

  • In CASE You Want to Use Logic in Snowflake

    Sometimes you need to check one field to see if you want to display another field. Sometimes you show one of two fields depending on the value in yet another field. Sometimes you just need to relax… Today, though, we’re going to go thru a myriad of functions that you can use in Snowflake to…