Reading Time: 7 minutesThere are several ways we can guarantee unique values in our primary key columns in our SQL Server tables. One data type we can use to store unique values is the UNIQUEIDENTIFER. In this very brief tutorial, we’ll talk about what the SQL Server UNIQUEIDENTIFIER data type is and how Continue Reading
Josh D
SQL Server Implicit Transaction Mode: Proceed with Caution!
Reading Time: 4 minutesImplicit transactions are a strange thing in SQL Server. It’s very important to understand how transactions work in Microsoft SQL Server and to understand the different tools available to us when writing transactions. One such tool is the “IMPLICIT_TRANSACTIONS” mode. But beware. Enabling this feature can have unforeseen consequences! In Continue Reading
How To Get a Running Total of Your SQL Data: Explained for Beginners
Reading Time: 5 minutesIn this very brief tutorial, we’ll discuss how to gather a very particular kind of SQL data: A running total. The best way I found to gather a running total (sometimes called a rolling total) of SQL data is to… Use the SUM() aggregate window function There might be other Continue Reading
SQL Server NULLIF: Explained for Beginners
Reading Time: 5 minutesThere are many ways we can compare the equivalency of two values in Microsoft SQL Server. We can use the regular equals ( = ) operator in an IF statement, for example, or we can use the handy CASE statement within the column list of a SELECT statement. But there Continue Reading
Do you know this rule about the CAST function?
Reading Time: 3 minutesThe CAST() system function is one of the most useful tools we have available to us in Microsoft SQL Server. We basically use it to convert a value from one data type to another on-the-fly. I was using CAST() in a query recently and encountered an interesting problem. If you Continue Reading
FULL OUTER JOIN: The Ultimate Guide for Beginners
Reading Time: 8 minutesOne of the most common tools we use when querying SQL Server databases is the JOIN operation. There are many different kinds of JOIN operations in SQL Server, including: INNER JOIN LEFT OUTER JOIN RIGHT OUTER JOIN CROSS JOIN In this very brief tutorial, we’ll discuss a fifth type of Continue Reading
RIGHT JOIN in SQL Server: Explained for Beginners
Reading Time: 7 minutesThe 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 minutesThe 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
Do you understand this rule about SQL Server aggregate functions?
Reading Time: 4 minutesAggregate functions in SQL Server are usually fairly straightforward tools. We normally use them in a GROUP BY clause to present meaningful aggregate information about our data. I recently came across an interesting problem at work dealing with aggregate functions that I thought would make a great tutorial. I hope Continue Reading
Stored Procedure Output Parameters: A Guide for Beginners
Reading Time: 3 minutesStored procedures are some of the most complex objects we have available to us in Microsoft SQL Server. There are many tips and tricks you need to know when creating and using them in your databases. In this very brief tutorial, we’ll talk about one of the more confusing things Continue Reading