Database Migration to Snowflake: Best Practices and Tips

Moving your legacy data warehouse to the Snowflake Data Cloud is one of the best decisions you can make for performance, scalability, and cost-efficiency. However, migrating from traditional systems like Oracle, Netezza, Teradata, or SQL Server is rarely a simple "lift and shift" operation. Without a solid strategy, you risk data loss, security gaps, and unexpected cloud computing costs. In this guide, we will break down the essential steps for a successful Snowflake migration and the best practices you need to follow to optimize your new environment. Page Content Introduction…

Continue ReadingDatabase Migration to Snowflake: Best Practices and Tips
Comments Off on Database Migration to Snowflake: Best Practices and Tips

Blocks in Snowflake Scripting: Complete Guide with Examples

If you are writing procedural code in Snowflake like loops, branching logic, or error handling you will use blocks in Snowflake scripting. A block is the fundamental structure that groups your SQL and programmatic logic together. In this guide, we will break down exactly how to structure a block, the difference between stored procedures and anonymous blocks, and look at fully runnable examples you can use right away. Blocks in Snowflake Scripting Page Contents Blocks in Snowflake Scripting Types of Blocks in Snowflake Scripting Block in a Stored Procedure Anonymous…

Continue ReadingBlocks in Snowflake Scripting: Complete Guide with Examples
Comments Off on Blocks in Snowflake Scripting: Complete Guide with Examples

Oracle DML LOG ERROR Alternative in Snowflake

Are you looking for an Oracle DML LOG ERROR alternative in Snowflake? When migrating your databases, you might realize you miss Oracle's native error-logging features. In this post, we will walk through the best workarounds for Snowflake DML error handling so you can seamlessly capture bad records using simple scripting and Snowpark. Page Content Introduction Oracle DML Error Logging Snowflake Script Error Logging to Capture Reject Rows Snowpark Error Handling to Capture Reject Rows Conclusion Introduction Oracle database offers very friendly error handling options that make life easier for developers…

Continue ReadingOracle DML LOG ERROR Alternative in Snowflake
Comments Off on Oracle DML LOG ERROR Alternative in Snowflake

Snowflake NULL Functions: A Complete Guide with Examples

Working with dirty data is a daily reality for data engineers and analysts, and missing values are one of the most common culprits. Handling these missing values effectively ensures your reporting and analytics remain accurate and reliable. Lets see how to handle these missing data using Snowflake NULL functions. Page Content Introduction Overview of Snowflake NULL Functions Snowflake NVL and NVL2 Functions COALESCE Function in Snowflake IFNULL Function in Snowflake ZEROIFNULL Function in Snowflake NULLIF Function in Snowflake IS NULL and IS NOT NULL Operators EQUAL_NULL Function in Snowflake IS_NULL_VALUE…

Continue ReadingSnowflake NULL Functions: A Complete Guide with Examples
Comments Off on Snowflake NULL Functions: A Complete Guide with Examples

How to Create View Dynamically in Snowflake?

The best part about Snowflake is that it supports almost all features that are available in any modern data warehouse. One of such a feature is dynamic SQL. You can execute SQL statements dynamically using Snowflake stored procedures. Snowflake supports JavaScript API to write stored procedures and user-defined functions. Note that, there is a difference between Snowflake stored procedure and UDFs. We will use stored procedures to create a view dynamically in Snowflake. Create View Dynamically in Snowflake In a data warehouse application, you will always get requirement to write…

Continue ReadingHow to Create View Dynamically in Snowflake?
Comments Off on How to Create View Dynamically in Snowflake?

Snowflake Conditional Insert: Multi-Table Syntax & Examples

Are you looking for a faster way to route data into multiple tables without writing separate queries? Using a Snowflake conditional insert allows you to seamlessly distribute data from a single source into various target tables. Page Content Introduction Understanding Multi-Table Inserts in Snowflake Conditional Inserts into Snowflake Tables Conditional Insert Syntax Examples of Conditional Inserts (ALL, FIRST, VALUES, OVERWRITE) Unconditional Inserts into Snowflake Tables Unconditional Insert Syntax and Examples Conclusion Introduction The Snowflake cloud data warehouse offers several advanced features that simplify data engineering workflows, and one standout capability…

Continue ReadingSnowflake Conditional Insert: Multi-Table Syntax & Examples
Comments Off on Snowflake Conditional Insert: Multi-Table Syntax & Examples

How to Drop or Reset All SQL Variables in a Snowflake Session?

Managing session variables in Snowflake can sometimes feel like a juggling act, especially when dealing with complex scripts or parameterized queries. If you have ever needed a quick way to clean the slate without manually unsetting dozens of values, you are in the right place. Page Content Introduction Understanding Snowflake SQL Variables Essential Commands: SET, UNSET, and SHOW Method 1: Drop All Variables Using a Stored Procedure (Recommended) Method 2: Abort the Current Snowflake Session Conclusion Introduction Snowflake allows users to declare SQL session variables to store application-specific environmental variables,…

Continue ReadingHow to Drop or Reset All SQL Variables in a Snowflake Session?
Comments Off on How to Drop or Reset All SQL Variables in a Snowflake Session?

Snowflake LIMIT and OFFSET: Syntax, Use Cases, and Examples

Are you trying to restrict the number of rows returned by your SQL queries without pulling the entire dataset? Using the LIMIT and OFFSET clauses in Snowflake is the most efficient way to achieve this. Page Content Introduction Snowflake LIMIT and OFFSET Overview Snowflake LIMIT Clause in Action Snowflake LIMIT Clause Parameters Snowflake OFFSET Clause for Pagination Snowflake OFFSET Clause Parameters Snowflake OFFSET Without LIMIT Conclusion Introduction When working with massive datasets, fetching every single row isn't always practical or necessary. The LIMIT clause in Snowflake is designed to restrict…

Continue ReadingSnowflake LIMIT and OFFSET: Syntax, Use Cases, and Examples
Comments Off on Snowflake LIMIT and OFFSET: Syntax, Use Cases, and Examples

How to Query S3 External Files in Snowflake?

You can integrate the cloud storages, such as AWS S3, Azure Blob and GCP cloud storage with Snowflake cloud data warehouse very easily. Snowflake does support external tables, you can create external tables on the top of the files stored on the external storages such as S3, blob or GCP storage. In this article, we will check how to query S3 external files directly in Snowflake. How to Query S3 External Files in Snowflake? Snowflake Cloud data warehouse supports using standard SQL to query data files located in an internal…

Continue ReadingHow to Query S3 External Files in Snowflake?
Comments Off on How to Query S3 External Files in Snowflake?

How to Get Row Count of Database Tables in Snowflake?

Counting the number of records from the database tables is one of the mandatory checks when you migrate data from one server to another. Snowflake is very rich in metadata information. It captures many useful information such as details about tables, columns, views, etc. In this article, we will write few useful queries to get row count of Snowflake database tables. Get Row Count of Database Tables in Snowflake You can look for object metadata information either in INFROMATION_SCHEMA for a particular database or utilize the ACCOUNT_USAGE that Snowflake provides…

Continue ReadingHow to Get Row Count of Database Tables in Snowflake?
Comments Off on How to Get Row Count of Database Tables in Snowflake?