Reading Time: 2 minutesThe 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
SQL Server Triggers: The Ultimate Guide for Beginners
Reading Time: 13 minutesSQL Server Triggers are some of the most helpful objects available to us in Microsoft SQL Server. A proper understanding of triggers is essential if you are looking to enter the field of database design and development. In this tutorial, we’ll discuss everything you need to know about triggers in Continue Reading
How to find a string within a string in SQL Server: Explained with Examples
Reading Time: 5 minutesThe task of finding a character string within a larger character string in a SQL Server database is very easy. SQL Server has many built-in system functions that can be used for character string manipulation, one of which is the CHARINDEX function. We use the CHARINDEX system function to locate Continue Reading
How to drop a constraint in SQL Server: Explained with Examples
Reading Time: 4 minutesIt’s very easy to drop a constraint on a column in a table. This is something you might need to do if you find yourself needing to drop the column, for example. SQL Server simply will not let you drop a column if that column has any kind of constraint Continue Reading
How to drop a column in SQL Server: Explained with Examples
Reading Time: 4 minutesKnowing how to make modifications to the definition of a table is very important when it comes to developing Microsoft SQL Server databases. The task of deleting a column is very straightforward. In this very brief tutorial, we’ll discuss how to drop a column from a Microsoft SQL Server table. Continue Reading
How to Find Text in a SQL Server Stored Procedure: Just run this one query!
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