Reading Time: 3 minutes The SQL Server ISNULL system function is one of the most useful functions you will use in your work as a data professional. The ISNULL function is meant to help you deal with NULLs in SQL Server. It’s meant to be used as an error handling tool of sorts. The Continue Reading
The Basics
Don’t make this OUTER JOIN mistake!
Reading Time: 4 minutes The OUTER JOIN operations, such as LEFT JOIN and RIGHT JOIN, are very important to know when it comes to querying Microsoft SQL Server databases. There is one important factoid you should know if you are using an OUTER JOIN in combination with the IS NULL predicate. Let’s create a Continue Reading
SQL Server CHOOSE: Explained
Reading Time: 3 minutes The SQL Server CHOOSE function is a simple decision structure you can use to simplify an otherwise complex expression. The syntax for CHOOSE is extremely simple: CHOOSE(<integer>, <expression1>, <expression2>,……<expressionN>) All you do it outline an integer as the first parameter, followed by a comma-separated list of expressions. The expressions can Continue Reading
SQL Server DROP IF EXISTS: Explained with Examples
Reading Time: 4 minutes In SQL Server version 2016, Microsoft introduced an extremely handy tool called DROP IF EXISTS to make our database development lives so must easier. In this very brief tutorial, we’ll walk through the syntax of the DROP IF EXISTS tool and show you a few examples of how to use Continue Reading
SQL Server TRUNCATE TABLE: Everything you need to know
Reading Time: 6 minutes The TRUNCATE TABLE statement is a simple statement that has a very singular purpose in Microsoft SQL Server. In this very brief tutorial, we’ll cover all the important information you need to know about the TRUNCATE TABLE statement. We’ll cover these topics: What is the SQL Server TRUNCATE TABLE statement? Continue Reading
How to break a WHILE loop in SQL Server: Explained with Examples
Reading Time: 2 minutes The task of breaking a WHILE loop in Microsoft SQL Server is very simple. We basically break a while loop when we want to terminate the loop early. That is, earlier than the loop would have ended if left to it’s natural progression. To break a WHILE loop early, just Continue Reading
What does “SET NOCOUNT ON” do in SQL Server? Explained!
Reading Time: 5 minutes Maybe you’ve been working with SQL Server for a while and have seen “SET NOCOUNT ON” here and there, but you aren’t really sure what it does. It’s usually seen within stored procedures, but it can be used anywhere. In this very brief tutorial, we’ll discuss what the SET NOCOUNT Continue Reading
RIGHT JOIN in SQL Server: Explained for Beginners
Reading Time: 7 minutes The JOIN operation in SQL Server is probably one of the most widely used querying tools available to us in Microsoft SQL Server. It is very important that you how JOINs work and the differences between the different types of JOINs. One type of JOIN is the RIGHT JOIN. In Continue Reading
LEFT JOIN and LEFT OUTER JOIN: What’s the difference?
Reading Time: 2 minutes The JOIN operations can be a bit tricky in Microsoft SQL Server. If you are new to SQL Server, you might be trying to understand the different JOIN operations and how they work. You probably have some basic questions you’d like answered. When I was first starting out with SQL Continue Reading
SQL IF EXISTS Decision Structure: Explained with Examples
Reading Time: 6 minutes The SQL IF EXISTS tool is great to know for managing the flow of control of your SQL code. In this very brief tutorial, we’ll discuss everything you need to know about the IF EXISTS decision structure in SQL Server. We’ll discuss these topics: What is the SQL IF EXISTS Continue Reading