Reading Time: 4 minutesThere might be times when you simply need to search through the objects in a SQL Server database for a specific word or text. It would be a very tedious task to open each stored procedure, function, View, etc. and look through each to see if it references the text Continue Reading
What does “SET NOCOUNT ON” do in SQL Server? Explained!
Reading Time: 5 minutesMaybe 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
How to find foreign key references in SQL Server: Just run this one query!
Reading Time: 4 minutesSQL Server foreign key constraints are one of the most useful tools available to us for maintaining the integrity of our data. If you want to find all the foreign key references in your database, there is a very simple query you can run. Just query the sys.foreign_keys and sys.foreign_key_columns Continue Reading
How to find a SQL Server column name: Run this one simple query!
Reading Time: 3 minutesIf 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 minutesThe 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 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
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