Reading Time: 3 minutes If you have a particularly large database, finding a specific column might be a bit of a challenge. Maybe you don’t recall exactly what the column name is, and you’re not sure what table it belongs to. Luckily, Microsoft SQL Server has some build in system tables that can help Continue Reading
How to reseed an IDENTITY value in SQL Server: A guide for beginners
Reading Time: 5 minutes The IDENTITY property is one of the most useful tools available to us in Microsoft SQL Server. We basically use it to automatically populate an integer column with a new value on inserts. It’s a great way to let SQL Server manage the integer values placed in a column so Continue Reading
UNIQUEIDENTIFIER: Explained for Beginners
Reading Time: 7 minutes There 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
SQL Server Implicit Transaction Mode: Proceed with Caution!
Reading Time: 4 minutes Implicit 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 minutes In 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 minutes There 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 minutes The 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 minutes One 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 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