How to make a column NOT NULL in SQL Server: Explained with Examples

Reading Time: 3 minutes You may find yourself needing the change the definition of a table or column from time-to-time while working as a database professional. One change you may need to make is changing a column from nullable to non nullable. It may have been decided that we actually don’t want NULL to appear Continue Reading

Difference between unique constraints and primary key constraints: Answered with examples

Reading Time: 4 minutes A primary key constraint and a unique constraint are both meant to enforce uniqueness in column(s). Since that’s true, it begs the question: What’s the difference? In this very brief tutorial, we’ll discuss the two main differences between primary key constraints and unique constraints. Difference # 1: Primary key constraints Continue Reading

How to disable a Foreign Key Constraint: Run this ONE simple statement!

Reading Time: 3 minutes Foreign key constraints are an excellent way to preserve the referential integrity of the data in your database. If you’re new to SQL Server and don’t fully understand what a foreign key is or how they work, make sure you check out the full beginner-friendly tutorial first to learn everything Continue Reading